/usr/include/simbody/SimTKcommon/internal/MatrixCharacteristics.h is in libsimbody-dev 3.5.4+dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | #ifndef SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_
#define SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_
/* -------------------------------------------------------------------------- *
* Simbody(tm): SimTKcommon *
* -------------------------------------------------------------------------- *
* This is part of the SimTK biosimulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
* *
* Portions copyright (c) 2005-13 Stanford University and the Authors. *
* Authors: Michael Sherman *
* Contributors: *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may *
* not use this file except in compliance with the License. You may obtain a *
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* -------------------------------------------------------------------------- */
/** @file
*
* Here we declare the classes needed for managing the properties of matrices,
* which we call Matrix Characteristics.
*/
#include "SimTKcommon/Scalar.h"
#include <iostream>
#include <cassert>
#include <complex>
#include <cstddef>
#include <utility> // for std::pair
namespace SimTK {
class MatrixStructure;
class MatrixStorage;
class MatrixOutline;
class MatrixCondition;
class MatrixCharacter;
class MatrixCommitment;
// ------------------------------ MatrixStructure -----------------------------
/// Matrix "structure" refers to an inherent mathematical (or at least
/// algorithmic) characteristic of the matrix rather than a storage strategy.
/// Symmetry is the clearest example of this; it is far more significant
/// mathematically than just a way to save storage and reduce operation count.
// ----------------------------------------------------------------------------
class SimTK_SimTKCOMMON_EXPORT MatrixStructure {
public:
enum Structure {
NoStructure = 0x00000000, ///< unspecified structure
Matrix1d = 0x00000001, ///< a 1-d matrix (could be row or column)
Zero = 0x00000002, ///< a matrix of all zeroes
Identity = 0x00000004, ///< diagonal matrix with repeated 1's
Permutation = 0x00000008, ///< permutation of an identity matrix
RepeatedDiagonal = 0x00000010, ///< diagonal matrix with repeated element
Diagonal = 0x00000020, ///< diagonal matrix with arbitrary elements
BiDiagonal = 0x00000040, ///< diagonal plus one upper or lower band
TriDiagonal = 0x00000080, ///< diagonal plus one upper and one lower band
BandedSymmetric = 0x00000100, ///< diagonal plus adjacent symmetric bands
BandedHermitian = 0x00000200, ///< diagonal plus adjacent conjugate bands
Banded = 0x00000400, ///< diagonal plus upper and lower bands
Triangular = 0x00000800, ///< diagonal plus all upper or all lower bands
QuasiTriangular = 0x00001000, ///< triangular but with 2x2 blocks on the diagonal
Hessenberg = 0x00002000, ///< triangular plus one band above/below diagonal
Symmetric = 0x00004000, ///< symmetric: elt(i,j)==elt(j,i)
Hermitian = 0x00008000, ///< hermitian: elt(i,j)==conjugate(elt(j,i))
SkewSymmetric = 0x00010000, ///< skew symmetric: elt(i,j) == -elt(j,i)
SkewHermitian = 0x00020000, ///< skew hermitian: elt(i,j) == -conjugate(elt(j,i))
Full = 0x00040000 ///< full mxn matrix, all elements distinct
};
static const char* name(Structure);
typedef unsigned int StructureMask; // 32 bits
static const StructureMask AnyStructure = 0x0007ffffU; // see above
static const StructureMask UncommittedStructure = 0xffffffffU;
static StructureMask calcStructureMask(Structure);
/// For triangular matrices, we have to know which triangle
/// we're talking about. Don't confuse this with MatrixStorage::Placement
/// which has to do with where we put it in memory, *not* what
/// matrix is being represented.
enum Position {
NoPosition = 0x0000,
Lower = 0x0001, // matrix is lower triangular (default)
Upper = 0x0002 // matrix is upper triangular
};
static const char* name(Position);
typedef unsigned short PositionMask; // 16 bits
static const PositionMask AnyPosition = 0x0003U; // see above
static const PositionMask UncommittedPosition = 0xffffU;
static PositionMask calcPositionMask(Structure);
/// For triangular, symmetric, and hermitian matrices the diagonal elements
/// may have a single, assumed value rather than being stored in memory.
/// This specifies the value. Don't confuse this with the similar
/// MatrixStorage type which simply says whether there is a known value
/// rather than stored values, *not* what that value is.
enum DiagValue {
NoDiagValue = 0x0000,
StoredDiag = 0x0001, // could be anything (default)
ZeroDiag = 0x0002, // zero (e.g. for skew matrices)
UnitDiag = 0x0004 // unit (one) diagonal is used frequently by Lapack
};
static const char* name(DiagValue);
typedef unsigned short DiagValueMask; // 16 bits
static const DiagValueMask AnyDiagValue = 0x0003U;
static const DiagValueMask UncommittedDiagValue = 0xffffU;
static DiagValueMask calcDiagValueMask(Structure);
MatrixStructure& setMissingAttributes() {
if (structure == NoStructure)
structure = Full;
if (position == NoPosition)
position = Lower;
if (diagValue == NoDiagValue)
diagValue = StoredDiag;
return *this;
}
std::string name() const {
return std::string(name(getStructure()))
+ "|" + std::string(name(getPosition()))
+ "|" + std::string(name(getDiagValue()));
}
struct Mask {
Mask() {setToUncommitted();}
Mask(StructureMask sm, PositionMask pm, DiagValueMask dm)
: structure(sm), position(pm), diagValue(dm) {}
Mask& setToUncommitted()
{ structure=UncommittedStructure; position=UncommittedPosition;
diagValue=UncommittedDiagValue; return *this; }
bool isUncommitted() const
{ return structure==UncommittedStructure && position==UncommittedPosition
&& diagValue==UncommittedDiagValue; }
bool isSatisfiedBy(Structure str, Position pos, DiagValue diag) const
{ return ((StructureMask)str&structure)==(StructureMask)str
&& ((PositionMask)pos&position)==(PositionMask)pos
&& ((DiagValueMask)diag&diagValue)==(DiagValueMask)diag; }
bool isSatisfiedBy(const MatrixStructure& actual) const
{ return isSatisfiedBy(actual.getStructure(), actual.getPosition(),
actual.getDiagValue()); }
StructureMask structure;
PositionMask position;
DiagValueMask diagValue;
};
MatrixStructure() {setToNone();}
/// This constructor is also an implicit conversion from the Structure enum
/// to a MatrixStructure object which does not specify Position or DiagValue.
MatrixStructure(Structure s, Position p=NoPosition, DiagValue d=NoDiagValue)
: structure(s), position(p), diagValue(d) {}
/// Given a Structure commitment, which more-restrictive Structures will
/// still satisfy this commitment? Returned value is a mask with a bit
/// set for every Structure that is satisfactory. For example, if the
/// commitment is "Banded", "Diagonal" is also acceptable.
Mask mask() const;
Structure getStructure() const {return structure;}
Position getPosition() const {return position;}
DiagValue getDiagValue() const {return diagValue;}
MatrixStructure& setStructure(Structure s) {structure=s; return *this;}
MatrixStructure& setPosition (Position p) {position=p; return *this;}
MatrixStructure& setDiagValue(DiagValue d) {diagValue=d; return *this;}
MatrixStructure& set(Structure s, Position p, DiagValue d)
{ structure=s; position=p; diagValue=d; return *this; }
MatrixStructure& setToNone()
{ structure=NoStructure; position=NoPosition;
diagValue=NoDiagValue; return *this; }
private:
Structure structure:32;
Position position:16;
DiagValue diagValue:16;
};
// ------------------------------ MatrixStorage -------------------------------
/// Matrix "storage" refers to the physical layout of data in the computer�s
/// memory. Whenever possible we attempt to store data in a format that enables
/// use of special high performance methods, such as those available in the
/// SimTK LAPACK/BLAS implementation.
// ----------------------------------------------------------------------------
class SimTK_SimTKCOMMON_EXPORT MatrixStorage {
public:
enum Packing {
NoPacking = 0x0000,
Full = 0x0001, // full storage layout
TriInFull = 0x0002, // a triangular piece of a full storage layout
TriPacked = 0x0004, // triangle packed into minimal storage, at performance cost
Banded = 0x0008, // a packed, banded storage format
Vector = 0x0010, // a possibly-strided or scattered vector
Scalar = 0x0020, // a single scalar is stored
Permutation = 0x0040 // a permuted identity matrix
};
static const char* name(Packing);
typedef unsigned short PackingMask;
static const PackingMask AllPacking = 0x007fU; // see above
static const PackingMask UncommittedPacking = 0xffffU;
enum Placement {
NoPlacement = 0x0000,
Lower = 0x0001, // stored in lower triangle of full matrix
Upper = 0x0002, // stored in upper triangle of full matrix
};
static const char* name(Placement);
typedef unsigned short PlacementMask;
static const PlacementMask AllPlacement = 0x0003U; // see above
static const PlacementMask UncommittedPlacement = 0xffffU;
enum Order {
NoOrder = 0x0000,
ColumnOrder = 0x0001, // matrix is stored by columns
RowOrder = 0x0002, // matrix is stored by rows
};
static const char* name(Order);
typedef unsigned short OrderMask;
static const OrderMask AllOrder = 0x03U; // see above
static const OrderMask UncommittedOrder = 0xffU;
enum Diagonal {
NoDiag = 0x0000,
StoredDiag = 0x0001, // matrix diagonal is stored
AssumedDiag = 0x0002 // matrix diagonal is not stored but has known value
};
static const char* name(Diagonal);
typedef unsigned short DiagonalMask;
static const DiagonalMask AllDiagonal = 0x0003U; // see above
static const DiagonalMask UncommittedDiagonal = 0xffffU;
/// Use this class to represent sets of acceptable values for each of
/// the storage attributes (packing, position, order, diagonal).
struct Mask {
Mask()
: packing(UncommittedPacking), placement(UncommittedPlacement),
order(UncommittedOrder), diagonal(UncommittedDiagonal) {}
Mask(PackingMask pkm, PlacementMask plm, OrderMask om, DiagonalMask dm)
: packing(pkm), placement(plm), order(om), diagonal(dm) {}
Mask& setToUncommitted()
{ packing=UncommittedPacking; placement=UncommittedPlacement;
order=UncommittedOrder; diagonal=UncommittedDiagonal; return *this; }
bool isUncommitted() const
{ return packing==UncommittedPacking && placement==UncommittedPlacement
&& order==UncommittedOrder && diagonal==UncommittedDiagonal; }
bool isSatisfiedBy(Packing pack, Placement place, Order ord, Diagonal diag) const
{ return ((PackingMask)pack & packing) == (PackingMask) pack
&& ((PlacementMask)place & placement) == (PlacementMask)place
&& ((OrderMask)ord & order) == (OrderMask) ord
&& ((DiagonalMask)diag & diagonal) == (DiagonalMask) diag; }
bool isSatisfiedBy(const MatrixStorage& actual) const
{ return isSatisfiedBy(actual.getPacking(), actual.getPlacement(),
actual.getOrder(), actual.getDiagonal());}
PackingMask packing;
PlacementMask placement;
OrderMask order;
DiagonalMask diagonal;
};
static MatrixStorage calcDefaultStorage(const MatrixStructure&,
const MatrixOutline&);
std::string name() const {
return std::string(name(getPacking()))
+ "|" + std::string(name(getPlacement()))
+ "|" + std::string(name(getOrder()))
+ "|" + std::string(name(getDiagonal()));
}
/// Calculate the commitment mask associated with specifying "this" set
/// of storage attributes as a commitment. Here the mask will either be
/// fully uncommitted or set to a specific value for each attribute; they
/// are all mutually exclusive.
Mask mask() const {
Mask ms; // initially uncommitted
if (packing) ms.packing = (PackingMask)packing;
if (placement) ms.placement = (PlacementMask)placement;
if (order) ms.order = (OrderMask)order;
if (diagonal) ms.diagonal = (DiagonalMask)diagonal;
return ms;
}
/// Default constructor leaves all fields unspecified.
MatrixStorage()
: packing(NoPacking), placement(NoPlacement), order(NoOrder), diagonal(NoDiag) {}
/// This constructor is also an implicit conversion from the Packing enum to a
/// MatrixStorage object which does not contain any specification for placement,
/// order, or storage of diagonal elements.
MatrixStorage(Packing pk, Placement pl=NoPlacement, Order o=NoOrder, Diagonal d=NoDiag)
: packing(pk), placement(pl), order(o), diagonal(d) {}
/// This constructor is for the common case of just packing and order, with
/// no particular placement and a stored diagonal.
MatrixStorage(Packing pk, Order o)
: packing(pk), placement(NoPlacement), order(o), diagonal(StoredDiag) {}
/// Assuming this is an actual matrix description, set any unspecified attributes
/// to appropriate defaults to match the specified packing.
MatrixStorage& setMissingAttributes() {
if (packing==NoPacking)
packing = Full;
if (placement==NoPlacement)
placement = Lower;
if (order==NoOrder)
order = ColumnOrder;
if (diagonal==NoDiag)
diagonal = StoredDiag;
return *this;
}
/// Restore this object to its default-constructed state of "none".
MatrixStorage& setToNone()
{ packing=NoPacking; placement=NoPlacement;
order=NoOrder; diagonal=NoDiag; return *this; }
MatrixStorage& setPacking(Packing p) {packing = p; return *this;}
MatrixStorage& setPlacement(Placement p) {placement = p; return *this;}
MatrixStorage& setOrder(Order o) {order = o; return *this;}
MatrixStorage& setDiagonal(Diagonal d) {diagonal = d; return *this;}
Packing getPacking() const {return packing;}
Placement getPlacement() const {return placement;}
Order getOrder() const {return order;}
Diagonal getDiagonal() const {return diagonal;}
private:
Packing packing:16;
Placement placement:16;
Order order:16;
Diagonal diagonal:16;
};
// ------------------------------- MatrixOutline ------------------------------
/// Matrix "outline" refers to the characteristic relationship between the number
/// of rows and columns of a matrix, without necessarily specifying the absolute
/// dimensions.
///
/// There are seven possible outline attributes:
/// - Rectangular (any m x n)
/// - Tall (m >= n)
/// - Wide (m <= n)
/// - Square (m == n)
/// - Column (m x 1)
/// - Row (1 x n)
/// - Scalar (1 x 1)
///
/// A matrix handle with no outline commitment can hold a general (rectangular)
/// matrix, which of course includes all the other outlines as well. Vector
/// handles are always committed to column outline, RowVector handles to row
/// outline. Scalar matrices are also rows, columns, and square and some
/// rows and columns are square (if they are 1x1).
///
/// Note that certain outlines imply fixed sizes of one or both dimensions.
// ----------------------------------------------------------------------------
class SimTK_SimTKCOMMON_EXPORT MatrixOutline {
public:
enum Outline {
NoOutline = 0x0000,
Scalar = 0x0001, // 1x1
Column = 0x0002, // mx1, m != 1
Row = 0x0004, // 1xn, n != 1
Square = 0x0008, // mxn, m == n
Wide = 0x0010, // mxn, m < n
Tall = 0x0020, // mxn, m > n
Rectangular = 0x0040 // mxn
};
static const char* name(Outline);
typedef unsigned short OutlineMask;
static const OutlineMask AnyOutline = 0x007fU; // see above
static const OutlineMask UncommittedOutline = 0xffffU;
struct Mask {
Mask() : outline(UncommittedOutline) {}
explicit Mask(OutlineMask mask) : outline(mask) {}
Mask& setToUncommitted() {outline=UncommittedOutline; return *this;}
bool isUncommitted() const {return outline==UncommittedOutline;}
bool isSatisfiedBy(const MatrixOutline& actual) const
{ return ((OutlineMask)actual.outline & outline) == (OutlineMask)actual.outline; }
OutlineMask outline;
};
std::string name() const {return std::string(name(getOutline()));}
/// Default constructor produces an object containing no outline specification.
/// If used as a commitment it won't accept \e any outline!
MatrixOutline() : outline(NoOutline) {}
/// This is an implicit conversion from the Outline enum to a MatrixOutline object.
MatrixOutline(Outline outline) : outline(outline) {}
/// Set the outline back to its default-constructed value of "none".
MatrixOutline& setToNone() {outline=NoOutline; return *this;}
/// Compute a mask of acceptable Outline values given a particular
/// value specified as a commitment. For example, if the commitment
/// is "Wide" then Square, Row, and Scalar outlines are also acceptable.
static OutlineMask calcMask(Outline);
/// When "this" outline is used as a commitment, it represents a mask of
/// acceptable outlines. Calculate and return that mask.
Mask mask() const {return Mask(calcMask(getOutline()));}
/// Determine if the proposed shape satisfies this outline.
bool isSizeOK(int m, int n) const;
/// Return the minimum shape that will satisfy this outline.
void getMinimumSize(int& m, int& n) const;
/// Determine the outline from given actual dimensions.
static MatrixOutline calcFromSize(int m, int n);
/// Return the outline value stored in this MatrixOutline object.
Outline getOutline() const {return outline;}
private:
Outline outline:16;
};
// ---------------------------- MatrixCondition -------------------------------
/// Matrix "condition" is a statement about the numerical characteristics of a
/// Matrix. It can be set as a result of an operation, or by a knowledgeable user.
/// Simmatrix is entitled to rely on the correctness of these assertions,
/// although it will try to check them if requested or when it is possible to do
/// so without sacrificing performance.
/// In most cases the condition will not be set at all, which we interpret to
/// mean "unknown condition" in an actual character, and "uncommitted" in
/// a character commitment.
// ----------------------------------------------------------------------------
class SimTK_SimTKCOMMON_EXPORT MatrixCondition {
public:
enum Condition {
UnknownCondition = 0x0000,
Orthogonal = 0x0001, // implies well conditioned
PositiveDefinite = 0x0002, // implies well conditioned
WellConditioned = 0x0004, // implies full rank
FullRank = 0x0008, // but might have bad conditioning
Singular = 0x0010 // implies possible bad conditioning
};
static const char* name(Condition);
typedef unsigned short ConditionMask; // 16 bits in mask
static const ConditionMask AnyCondition = 0x001fU; // see above
static const ConditionMask UncommittedCondition = 0xffffU;
enum Diagonal {
UnknownDiagonal = 0x0000, ///< we don't know the condition of the diagonal elements
ZeroDiagonal = 0x0001, ///< all diagonal elements are zero (also pure real and pure imaginary)
OneDiagonal = 0x0002, ///< all diagonal elements are one (and real)
RealDiagonal = 0x0004, ///< all diagonal elements are pure real
ImaginaryDiagonal = 0x0008 ///< all diagonal elements are pure imaginary
};
static const char* name(Diagonal);
typedef unsigned short DiagonalMask; // 16 bits in mask
static const DiagonalMask AnyDiagonal = 0x000fU; // see above
static const DiagonalMask UncommittedDiagonal = 0xffffU;
/// Use this class to represent a set of acceptable Condition values.
struct Mask {
Mask() : condition(UncommittedCondition), diagonal(UncommittedDiagonal) {}
Mask(ConditionMask cmask, DiagonalMask dmask) : condition(cmask), diagonal(dmask) {}
Mask& setToUncommitted()
{ condition=UncommittedCondition; diagonal=UncommittedDiagonal; return *this;}
bool isUncommitted() const
{ return condition==UncommittedCondition && diagonal==UncommittedDiagonal;}
bool isSatisfiedBy(const MatrixCondition& actual) const
{ return ((ConditionMask)actual.condition & condition) == (ConditionMask)actual.condition
&& ((DiagonalMask) actual.diagonal & diagonal) == (DiagonalMask)actual.diagonal; }
ConditionMask condition;
DiagonalMask diagonal;
};
std::string name() const
{ return std::string(name(getCondition())) + "|" + std::string(name(getDiagonal()));}
/// The default constructor sets the condition to Unknown, which is typically
/// where it remains.
MatrixCondition() : condition(UnknownCondition), diagonal(UnknownDiagonal) {}
/// This is an implicit conversion from the Condition enum to a
/// MatrixCondition object.
MatrixCondition(Condition cond, Diagonal diag=UnknownDiagonal)
: condition(cond), diagonal(diag) {}
/// Restore to default-constructed state of "none".
MatrixCondition& setToNone() {condition=UnknownCondition; diagonal=UnknownDiagonal; return *this;}
/// Given a particular Condition provided as a commitment, calculate
/// the mask of all Condition values that would satisfy that commitment.
/// For example, if the commitment is "WellConditioned" then "Orthogonal"
/// and "PositiveDefinite" also qualify since they are automatically
/// well conditioned. If the Condition is "Unknown" we'll return an Uncommitted mask.
static ConditionMask calcMask(Condition);
/// Given a particular Diagonal condition provided as a commitment, calculate
/// the mask of all Diagonal conditions taht would satisfy that commitment.
/// For example, if the commitment is "RealDiagonal" then "ZeroDiagonal"
/// and "OneDiagonal" would also be acceptable. If the Diagonal condition
/// is specified as "UnknownDiagonal" then we'll return an Uncommitted mask.
static DiagonalMask calcMask(Diagonal);
/// Return the commitment mask corresponding to use of "this" condition
/// as a commitment.
Mask mask() const
{ return Mask(calcMask(getCondition()), calcMask(getDiagonal())); }
Condition getCondition() const {return condition;}
Diagonal getDiagonal() const {return diagonal;}
MatrixCondition& setCondition(Condition c) {condition=c; return *this;}
MatrixCondition& setDiagonal (Diagonal d) {diagonal=d; return *this;}
private:
Condition condition:16;
Diagonal diagonal:16;
};
// ------------------------------ MatrixCharacter -----------------------------
/** A MatrixCharacter is a set containing a value for each of the matrix
characteristics except element type, which is part of the templatized
declaration of a Matrix_, Vector_, or RowVector_ handle. MatrixCharacters are
used both as the handle "commitment", setting restrictions on what kinds
of matrices a handle can reference, and as the "facts on the ground" current
character of the matrix being referenced. The current character must always
satisfy the character commitment.
%Matrix characteristics are specifications of particular aspects of matrices:
- Element type
- Size
- Structure
- Storage format
- Outline
- Conditioning
Collectively, the set of values for the above properties is called a <i>matrix
character</i>. A matrix character can be used to describe an existing matrix,
or a character mask can be used to describe the range of characteristics that
a matrix handle may support. The character mask describing the acceptable
matrices for a matrix handle is called the handle's <i>character commitment</i>
or just the <i>handle commitment</i>. The character describing an existing
matrix is called the <i>actual character</i> of that matrix. Thus there are
always two sets of characteristics associated with a matrix: the handle's
commitment, and the actual character of the matrix to which the handle currently
refers. The actual character must always \e satisfy the character commitment.
When a handle presents a view into another handle's data, it is the
characteristics of the matrix as seen through the view that must satisfy the
handle's character commitment. So for example, a view showing one column of a
full matrix satisfies a "column" outline commitment.
Element type for a matrix handle is always determined at compile time via the
template argument used in the declaration. For example, a matrix handle declared
\c Matrix_<Vec3> can only hold matrices whose elements are \c Vec3s. Also,
recall that \c Matrix is an abbreviation for \c Matrix_<Real> so that
declaration commits the matrix handle to Real-element matrices. Element type
is the only matrix characteristic for which no matrix handle can remain
uncommitted. However, different handles can provide views of the same data
through which that data is seen to contain different element types.
Each matrix characteristic other than sizes is represented by a class
defining one or more enumerated types, where individual characteristics are
assigned a single bit. Then an appropriate mask type (an unsigned integral
type) is defined which can represent a set of allowable characteristics.
The actual character of a matrix is represented via enumeration values; the
character commitment is represented by the compatible masks. The operation
of determining whether a particular actual character satisfies a handle
commitment can then be performed very quickly via bitwise logical operations.
**/
class SimTK_SimTKCOMMON_EXPORT MatrixCharacter {
public:
/// Default constructor sets lengths to zero and the other characteristics
/// to "none specified".
MatrixCharacter() : nr(0), nc(0), lband(0), uband(0) {}
// Some handy predefined MatrixCharacters.
class LapackFull;
class Vector;
class RowVector;
/// Restore this MatrixCharacter to its default-constructed state of "none".
MatrixCharacter& setToNone() {
nr=nc=lband=uband=0;
structure.setToNone(); outline.setToNone();
storage.setToNone(); condition.setToNone();
return *this;
}
/// These are dimensions of the logical matrix and have nothing to do with
/// how much storage may be used to hold the elements.
int nrow() const {return nr;}
int ncol() const {return nc;}
std::pair<int,int> getSize() const {return std::pair<int,int>(nrow(),ncol());}
ptrdiff_t nelt() const {return (ptrdiff_t)nrow() * (ptrdiff_t)ncol();}
int getLowerBandwidth() const {return lband;}
int getUpperBandwidth() const {return uband;}
std::pair<int,int> getBandwidth() const
{ return std::pair<int,int>(getLowerBandwidth(), getUpperBandwidth()); }
const MatrixStructure& getStructure() const {return structure;}
const MatrixStorage& getStorage() const {return storage;}
const MatrixOutline& getOutline() const {return outline;}
const MatrixCondition& getCondition() const {return condition;}
MatrixStructure& updStructure() {return structure;}
MatrixStorage& updStorage() {return storage;}
MatrixOutline& updOutline() {return outline;}
MatrixCondition& updCondition() {return condition;}
MatrixCharacter& setStructure(const MatrixStructure& sa) {structure = sa; return *this;}
MatrixCharacter& setStorage (const MatrixStorage& sa) {storage = sa; return *this;}
MatrixCharacter& setOutline (const MatrixOutline& oa) {outline = oa; return *this;}
MatrixCharacter& setCondition(const MatrixCondition& ca) {condition = ca; return *this;}
/// Set the actual size and update the outline to match.
MatrixCharacter& setActualSize(int m, int n)
{ setSize(m,n); outline = MatrixOutline::calcFromSize(m,n); return *this; }
MatrixCharacter& setActualNumRows(int m)
{ setNumRows(m); outline = MatrixOutline::calcFromSize(m,ncol()); return *this; }
MatrixCharacter& setActualNumCols(int n)
{ setNumCols(n); outline = MatrixOutline::calcFromSize(nrow(),n); return *this; }
MatrixCharacter& setBandwidth(int lb, int ub) {
assert(lb>=0 && lb>=0);
lband = lb; uband = ub;
return *this;
}
MatrixCharacter& setLowerBandwidth(int lb) {
assert(lb>=0);
lband = lb;
return *this;
}
MatrixCharacter& setUpperBandwidth(int ub) {
assert(ub>=0);
uband = ub;
return *this;
}
class Mask; // defined below
protected:
MatrixCharacter(int m, int n,
int lb, int ub,
MatrixStructure structure,
MatrixStorage storage,
MatrixCondition condition)
: nr(m), nc(n), lband(lb), uband(ub),
structure(structure), storage(storage),
outline(MatrixOutline::calcFromSize(m,n)),
condition(condition) {}
int nr, ///< actual number of rows
nc; ///< actual number of columns
int lband, ///< actual lower bandwidth, if banded
uband; ///< actual upper bandwidth, if banded
MatrixStructure structure;
MatrixStorage storage;
MatrixOutline outline;
MatrixCondition condition;
private:
// These are private because they don't set the outline as well.
MatrixCharacter& setSize(int m, int n)
{ assert(m>=0 && n>=0); nr = m; nc = n; return *this; }
MatrixCharacter& setNumRows(int m)
{ assert(m>=0); nr = m; return *this; }
MatrixCharacter& setNumCols(int n)
{ assert(n>=0); nc = n; return *this; }
};
/// Output a textual description of a MatrixCharacter; handy for debugging.
/// @relates SimTK::MatrixCharacter
SimTK_SimTKCOMMON_EXPORT std::ostream&
operator<<(std::ostream& o, const MatrixCharacter&);
/// Predefined MatrixCharacter for an ordinary Lapack-style full matrix
/// of a particular dimension m x n (nrows X ncols). Note that the storage
/// format allows for a "leading dimension" larger than m, but that the
/// leading dimension is not considered part of the matrix character. It is
/// dealt with separately.
class MatrixCharacter::LapackFull : public MatrixCharacter {
public:
LapackFull(int m, int n)
: MatrixCharacter(m,n,0,0,
MatrixStructure(MatrixStructure::Full),
MatrixStorage(MatrixStorage::Full,MatrixStorage::ColumnOrder),
MatrixCondition()) {}
};
/// Predefined MatrixCharacter for an ordinary column vector of a particular
/// size. Note that standard vector storage allows for a "stride" greater than
/// 1, but that is not considered part of the matrix character. Stride is
/// dealt with separately.
class MatrixCharacter::Vector : public MatrixCharacter {
public:
Vector(int m)
: MatrixCharacter(m,1,0,0,
MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(MatrixStorage::Vector,MatrixStorage::ColumnOrder),
MatrixCondition()) {}
};
/// Predefined MatrixCharacter for an ordinary row vector of a particular
/// size. Note that standard vector storage allows for a "stride" greater than
/// 1, but that is not considered part of the matrix character. Stride is
/// dealt with separately.
class MatrixCharacter::RowVector : public MatrixCharacter {
public:
RowVector(int n)
: MatrixCharacter(1,n,0,0,
MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(MatrixStorage::Vector,MatrixStorage::RowOrder),
MatrixCondition()) {}
};
// -------------------------- MatrixCharacter::Mask ---------------------------
/// This class collects masks of each characteristic type for representing sets
/// of accceptable characteristics.
// ----------------------------------------------------------------------------
class MatrixCharacter::Mask {
public:
Mask() {setToUncommitted();}
typedef unsigned int SizeMask;
static const SizeMask SizeUncommitted = 0xffffffffU;
bool isResizeable() const {return nr==SizeUncommitted || nc==SizeUncommitted;}
bool isFullyResizeable() const {return nr==SizeUncommitted && nc==SizeUncommitted;}
bool isNumRowsLocked() const {return nr!=SizeUncommitted;}
bool isNumColsLocked() const {return nc!=SizeUncommitted;}
unsigned int getNumRowsMask() const {return nr;}
unsigned int getNumColsMask() const {return nc;}
unsigned int getLowerBandwidthMask() const {return lband;}
unsigned int getUpperBandwidthMask() const {return uband;}
int getDefaultNumRows() const {return isNumRowsLocked() ? nr : 0;}
int getDefaultNumCols() const {return isNumColsLocked() ? nc : 0;}
bool isLowerBandwidthLocked() const {return lband!=SizeUncommitted;}
bool isUpperBandwidthLocked() const {return uband!=SizeUncommitted;}
int getDefaultLowerBandwidth() const {return isLowerBandwidthLocked() ? lband : 0;}
int getDefaultUpperBandwidth() const {return isUpperBandwidthLocked() ? uband : 0;}
/// Set all bits to one ("Uncommitted").
Mask& setToUncommitted() {
nr=nc=lband=uband=SizeUncommitted;
structure.setToUncommitted(); storage.setToUncommitted();
outline.setToUncommitted(); condition.setToUncommitted();
return *this;
}
/// Return if all fields are set to "Uncommitted" (all bits are one).
bool isUncommitted() const {
return nr==SizeUncommitted && nc==SizeUncommitted
&& lband==SizeUncommitted && uband==SizeUncommitted
&& structure.isUncommitted() && storage.isUncommitted()
&& outline.isUncommitted() && condition.isUncommitted();
}
/// Check whether an actual matrix character satisfies this matrix commitment.
bool isSatisfiedBy(const MatrixCharacter& actual) const {
return isSizeOK(actual.nr, actual.nc)
&& isBandwidthOK(actual.lband, actual.uband)
&& structure.isSatisfiedBy(actual.getStructure())
&& storage.isSatisfiedBy(actual.getStorage())
&& outline.isSatisfiedBy(actual.getOutline())
&& condition.isSatisfiedBy(actual.getCondition());
}
/// Check whether an actual size satisfies the size commitment.
bool isSizeOK(int m, int n) const
{ return ((SizeMask)m & nr) == (SizeMask)m
&& ((SizeMask)n & nc) == (SizeMask)n; }
/// Check whether an actual bandwidth satisfies the bandwidth commitment.
/// (If the matrix isn't banded any bandwidth will be OK.)
bool isBandwidthOK(int lower, int upper) const
{ return ((SizeMask)lower & lband) == (SizeMask)lower
&& ((SizeMask)upper & uband) == (SizeMask)upper; }
SizeMask nr, ///< number of rows
nc; ///< number of columns
SizeMask lband, ///< lower bandwidth, if banded
uband; ///< upper bandwidth, if banded
MatrixStructure::Mask structure;
MatrixStorage::Mask storage;
MatrixOutline::Mask outline;
MatrixCondition::Mask condition;
friend class MatrixCommitment;
};
// ----------------------------- MatrixCommitment -----------------------------
/// A MatrixCommitment provides a set of acceptable matrix characteristics.
/// Since we define the characteristics each with its own bit, a commitment
/// is implemented as a set of masks with bits set corresponding to the
/// acceptable characteristics.
// ----------------------------------------------------------------------------
class SimTK_SimTKCOMMON_EXPORT MatrixCommitment {
public:
MatrixCommitment() {} // set commitments to "none" and masks to "uncommitted"
/// This is an implicit conversion from a MatrixStructure specification to
/// a MatrixCommitment with storage, outline, and condition uncommitted.
MatrixCommitment(const MatrixStructure& str)
{ new (this) MatrixCommitment(str, MatrixStorage(), MatrixOutline(), MatrixCondition());}
class Vector;
class RowVector;
class Triangular;
class Symmetric;
class Hermitian;
class SkewSymmetric;
class SkewHermitian;
MatrixCommitment& commitSize(int m, int n)
{ commitNumRows(m); commitNumCols(n); return *this; }
MatrixCommitment& commitNumRows(int m)
{ SimTK_SIZECHECK_NONNEG(m, "MatrixCommitment::commitNumRows()");
masks.nr = m; return *this; }
MatrixCommitment& commitNumCols(int n)
{ SimTK_SIZECHECK_NONNEG(n, "MatrixCommitment::commitNumCols()");
masks.nc = n; return *this; }
MatrixCommitment& commitBandwidth(int lb, int ub)
{ commitLowerBandwidth(lb); commitUpperBandwidth(ub); return *this;}
MatrixCommitment& commitLowerBandwidth(int lb)
{ SimTK_SIZECHECK_NONNEG(lb, "MatrixCommitment::commitLowerBandwidth()");
masks.lband = lb; return *this; }
MatrixCommitment& commitUpperBandwidth(int ub)
{ SimTK_SIZECHECK_NONNEG(ub, "MatrixCommitment::commitUpperBandwidth()");
masks.uband = ub; return *this; }
MatrixCommitment& commitStructure(const MatrixStructure& s)
{ structure=s; masks.structure=s.mask(); return *this; }
MatrixCommitment& commitStorage (const MatrixStorage& s)
{ storage=s; masks.storage =s.mask(); return *this; }
MatrixCommitment& commitOutline (const MatrixOutline& o)
{ outline=o; masks.outline =o.mask(); return *this; }
MatrixCommitment& commitCondition(const MatrixCondition& c)
{ condition=c; masks.condition=c.mask(); return *this; }
/// For any handle commitment, we can calculate a "best character" for
/// an allocation that satisfies the commitment, optionally with an
/// initial allocation size. Typically it is the least-restrictive
/// actual character that satisfies the commitment. For
/// example, if the commitment is Triangular we'll allocate a full triangular
/// matrix, not a banded one, or a symmetric one, or for that matter an
/// identity matrix, all of which would satisfy the commitment.
/// The supplied sizes are used as minima -- if the commitment requires
/// a larger minimum size you'll get that. For example, if you specify
/// 0x0 but you're committed to a Column outline, you'll get 0x1.
MatrixCharacter calcDefaultCharacter(int minNumRows, int minNumCols) const;
/// These report the commitment as it was specified.
const MatrixStructure& getStructureCommitment() const {return structure;}
const MatrixStorage& getStorageCommitment() const {return storage;}
const MatrixOutline& getOutlineCommitment() const {return outline;}
const MatrixCondition& getConditionCommitment() const {return condition;}
/// These report the masks of acceptable values generated from the commitment.
const MatrixStructure::Mask& getStructureMask() const {return masks.structure;}
const MatrixStorage::Mask& getStorageMask() const {return masks.storage;}
const MatrixOutline::Mask& getOutlineMask() const {return masks.outline;}
const MatrixCondition::Mask& getConditionMask() const {return masks.condition;}
MatrixCharacter::Mask::SizeMask getNumRowsMask() const {return masks.nr;}
MatrixCharacter::Mask::SizeMask getNumColsMask() const {return masks.nc;}
MatrixCharacter::Mask::SizeMask getLowerBandwidthMask() const {return masks.lband;}
MatrixCharacter::Mask::SizeMask getUpperBandwidthMask() const {return masks.uband;}
int getDefaultNumRows() const {return masks.getDefaultNumRows();}
int getDefaultNumCols() const {return masks.getDefaultNumRows();}
bool isSizeOK(int m, int n) const {return masks.isSizeOK(m,n);}
bool isSizeOK(const std::pair<int,int>& mn) const
{ return isSizeOK(mn.first, mn.second); }
bool isBandwidthOK(int lower, int upper) const {return masks.isBandwidthOK(lower,upper);}
bool isSatisfiedBy(const MatrixCharacter& actual) const
{ return masks.isSatisfiedBy(actual); }
bool isStructureOK(const MatrixStructure& s) const
{ return getStructureMask().isSatisfiedBy(s); }
bool isStorageOK(const MatrixStorage& s) const
{ return getStorageMask().isSatisfiedBy(s); }
bool isOutlineOK(const MatrixOutline& o) const
{ return getOutlineMask().isSatisfiedBy(o); }
bool isConditionOK(const MatrixCondition& c) const
{ return getConditionMask().isSatisfiedBy(c); }
bool isResizeable() const {return masks.isResizeable();}
bool isFullyResizeable() const {return masks.isFullyResizeable();;}
bool isNumRowsLocked() const {return masks.isNumRowsLocked();}
bool isNumColsLocked() const {return masks.isNumColsLocked();}
bool isStructureCommitted() const
{ return !getStructureMask().isUncommitted(); }
bool isStorageCommitted() const
{ return !getStorageMask().isUncommitted();}
bool isOutlineCommitted() const
{ return !getOutlineMask().isUncommitted(); }
bool isConditionCommitted() const
{ return !getConditionMask().isUncommitted();}
/// Set commitment s to "none" and masks to "uncommitted" for all characteristics.
void clear() {
structure.setToNone();
storage.setToNone();
outline.setToNone();
condition.setToNone();
masks.setToUncommitted();
}
protected:
MatrixCommitment(const MatrixStructure& structure,
const MatrixStorage& storage,
const MatrixOutline& outline,
const MatrixCondition& condition)
: structure(structure), storage(storage),
outline(outline), condition(condition),
masks() // set to all 1's
{
if (outline.getOutline()==MatrixOutline::Scalar) commitSize(1,1);
else if (outline.getOutline()==MatrixOutline::Column) commitNumCols(1);
else if (outline.getOutline()==MatrixOutline::Row) commitNumRows(1);
masks.structure = structure.mask();
masks.storage = storage.mask();
masks.outline = outline.mask();
masks.condition = condition.mask();
}
/// These are the commitments as specified. They are used to fill in
/// the corresponding bitmasks of acceptable characteristics below.
MatrixStructure structure;
MatrixStorage storage;
MatrixOutline outline;
MatrixCondition condition;
/// These are the bitmasks of acceptable characteristics which
/// would satisfy the above-specified commitments.
MatrixCharacter::Mask masks;
};
/// This is the default commitment for a column vector.
class MatrixCommitment::Vector : public MatrixCommitment {
public:
/// Commit to a resizeable column vector.
Vector()
: MatrixCommitment
( MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(),
MatrixOutline(MatrixOutline::Column),
MatrixCondition())
{
}
/// Commit to a column vector of a particular length.
explicit Vector(int m)
: MatrixCommitment
( MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(),
MatrixOutline(MatrixOutline::Column),
MatrixCondition())
{
commitNumRows(m);
}
};
/// This is the default commitment for a row vector.
class MatrixCommitment::RowVector : public MatrixCommitment {
public:
/// Commit to a resizeable row vector.
RowVector()
: MatrixCommitment
( MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(),
MatrixOutline(MatrixOutline::Row),
MatrixCondition())
{
}
/// Commit to a row vector of a particular length.
explicit RowVector(int n)
: MatrixCommitment
( MatrixStructure(MatrixStructure::Matrix1d),
MatrixStorage(),
MatrixOutline(MatrixOutline::Row),
MatrixCondition())
{
commitNumCols(n);
}
};
/// This is the default commitment for a triangular matrix.
class MatrixCommitment::Triangular : public MatrixCommitment {
public:
Triangular()
: MatrixCommitment(MatrixStructure::Triangular, MatrixStorage(),
MatrixOutline(), MatrixCondition())
{
}
};
/// This is the default commitment for a symmetric (*not* Hermitian) matrix.
/// There are no restrictions on the underlying elements or diagonals.
class MatrixCommitment::Symmetric : public MatrixCommitment {
public:
Symmetric()
: MatrixCommitment(MatrixStructure::Symmetric, MatrixStorage(),
MatrixOutline(), MatrixCondition())
{
}
};
/// This is the default commitment for a Hermitian (*not* symmetric) matrix.
/// Diagonal elements must be real since they have to serve as their own
/// conjugates.
class MatrixCommitment::Hermitian : public MatrixCommitment {
public:
Hermitian()
: MatrixCommitment
( MatrixStructure::Hermitian,
MatrixStorage(),
MatrixOutline(),
MatrixCondition().setDiagonal(MatrixCondition::RealDiagonal))
{
}
};
/// This is the default commitment for skew symmetric (*not* skew Hermitian)
/// matrix. Diagonal elements must be all-zero since they have to be their
/// own negation. Otherwise any elements are acceptable.
class MatrixCommitment::SkewSymmetric : public MatrixCommitment {
public:
SkewSymmetric()
: MatrixCommitment
( MatrixStructure::SkewSymmetric,
MatrixStorage(),
MatrixOutline(),
MatrixCondition().setDiagonal(MatrixCondition::ZeroDiagonal))
{
}
};
/// This is the default commitment for a skew Hermitian (*not* skew symmetric)
/// matrix. Diagonal elements must be pure imaginary since when conjugated they
/// must be their own negation for a skew matrix.
class MatrixCommitment::SkewHermitian : public MatrixCommitment {
public:
SkewHermitian()
: MatrixCommitment
( MatrixStructure::SkewHermitian,
MatrixStorage(),
MatrixOutline(),
MatrixCondition().setDiagonal(MatrixCondition::ImaginaryDiagonal))
{
}
};
/// Output a textual description of a MatrixCommitment; handy for debugging.
/// @relates SimTK::MatrixCommitment
SimTK_SimTKCOMMON_EXPORT std::ostream&
operator<<(std::ostream& o, const MatrixCommitment&);
} //namespace SimTK
#endif // SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_
|