1 #ifndef SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_ 2 #define SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_ 44 class MatrixStructure;
47 class MatrixCondition;
48 class MatrixCharacter;
49 class MatrixCommitment;
61 NoStructure = 0x00000000,
62 Matrix1d = 0x00000001,
64 Identity = 0x00000004,
65 Permutation = 0x00000008,
66 RepeatedDiagonal = 0x00000010,
67 Diagonal = 0x00000020,
68 BiDiagonal = 0x00000040,
69 TriDiagonal = 0x00000080,
70 BandedSymmetric = 0x00000100,
71 BandedHermitian = 0x00000200,
73 Triangular = 0x00000800,
74 QuasiTriangular = 0x00001000,
75 Hessenberg = 0x00002000,
76 Symmetric = 0x00004000,
77 Hermitian = 0x00008000,
78 SkewSymmetric = 0x00010000,
79 SkewHermitian = 0x00020000,
85 static const StructureMask AnyStructure = 0x0007ffffU;
86 static const StructureMask UncommittedStructure = 0xffffffffU;
87 static StructureMask calcStructureMask(
Structure);
101 static const PositionMask AnyPosition = 0x0003U;
102 static const PositionMask UncommittedPosition = 0xffffU;
103 static PositionMask calcPositionMask(
Structure);
111 NoDiagValue = 0x0000,
119 static const DiagValueMask AnyDiagValue = 0x0003U;
120 static const DiagValueMask UncommittedDiagValue = 0xffffU;
121 static DiagValueMask calcDiagValueMask(
Structure);
124 if (structure == NoStructure)
126 if (position == NoPosition)
128 if (diagValue == NoDiagValue)
129 diagValue = StoredDiag;
134 return std::string(name(getStructure()))
135 +
"|" + std::string(name(getPosition()))
136 +
"|" + std::string(name(getDiagValue()));
141 Mask(StructureMask sm, PositionMask pm, DiagValueMask dm)
142 : structure(sm), position(pm), diagValue(dm) {}
144 { structure=UncommittedStructure; position=UncommittedPosition;
145 diagValue=UncommittedDiagValue;
return *
this; }
147 {
return structure==UncommittedStructure && position==UncommittedPosition
148 && diagValue==UncommittedDiagValue; }
150 {
return ((StructureMask)str&structure)==(StructureMask)str
151 && ((PositionMask)pos&position)==(PositionMask)pos
152 && ((DiagValueMask)diag&diagValue)==(DiagValueMask)diag; }
167 : structure(s), position(p), diagValue(d) {}
184 { structure=s; position=p; diagValue=d;
return *
this; }
187 { structure=NoStructure; position=NoPosition;
188 diagValue=NoDiagValue;
return *
this; }
215 static const char* name(
Packing);
217 static const PackingMask AllPacking = 0x007fU;
218 static const PackingMask UncommittedPacking = 0xffffU;
221 NoPlacement = 0x0000,
227 static const PlacementMask AllPlacement = 0x0003U;
228 static const PlacementMask UncommittedPlacement = 0xffffU;
232 ColumnOrder = 0x0001,
235 static const char* name(
Order);
237 static const OrderMask AllOrder = 0x03U;
238 static const OrderMask UncommittedOrder = 0xffU;
247 static const DiagonalMask AllDiagonal = 0x0003U;
248 static const DiagonalMask UncommittedDiagonal = 0xffffU;
254 : packing(UncommittedPacking), placement(UncommittedPlacement),
255 order(UncommittedOrder), diagonal(UncommittedDiagonal) {}
256 Mask(PackingMask pkm, PlacementMask plm, OrderMask om, DiagonalMask dm)
257 : packing(pkm), placement(plm), order(om), diagonal(dm) {}
259 { packing=UncommittedPacking; placement=UncommittedPlacement;
260 order=UncommittedOrder; diagonal=UncommittedDiagonal;
return *
this; }
262 {
return packing==UncommittedPacking && placement==UncommittedPlacement
263 && order==UncommittedOrder && diagonal==UncommittedDiagonal; }
265 {
return ((PackingMask)pack & packing) == (PackingMask) pack
266 && ((PlacementMask)place & placement) == (PlacementMask)place
267 && ((OrderMask)ord & order) == (OrderMask) ord
268 && ((DiagonalMask)diag & diagonal) == (DiagonalMask) diag; }
283 return std::string(name(getPacking()))
284 +
"|" + std::string(name(getPlacement()))
285 +
"|" + std::string(name(getOrder()))
286 +
"|" + std::string(name(getDiagonal()));
295 if (packing) ms.
packing = (PackingMask)packing;
296 if (placement) ms.
placement = (PlacementMask)placement;
297 if (order) ms.
order = (OrderMask)order;
298 if (diagonal) ms.
diagonal = (DiagonalMask)diagonal;
304 : packing(NoPacking), placement(NoPlacement), order(NoOrder), diagonal(NoDiag) {}
310 : packing(pk), placement(pl), order(o), diagonal(d) {}
315 : packing(pk), placement(NoPlacement), order(o), diagonal(StoredDiag) {}
320 if (packing==NoPacking)
322 if (placement==NoPlacement)
326 if (diagonal==NoDiag)
327 diagonal = StoredDiag;
333 { packing=NoPacking; placement=NoPlacement;
334 order=NoOrder; diagonal=NoDiag;
return *
this; }
388 static const char* name(
Outline);
391 static const OutlineMask AnyOutline = 0x007fU;
392 static const OutlineMask UncommittedOutline = 0xffffU;
395 Mask() : outline(UncommittedOutline) {}
396 explicit Mask(OutlineMask mask) : outline(mask) {}
400 {
return ((OutlineMask)actual.outline & outline) == (OutlineMask)actual.outline; }
405 std::string
name()
const {
return std::string(
name(getOutline()));}
420 static OutlineMask calcMask(
Outline);
427 bool isSizeOK(
int m,
int n)
const;
430 void getMinimumSize(
int& m,
int& n)
const;
457 UnknownCondition = 0x0000,
459 PositiveDefinite = 0x0002,
460 WellConditioned = 0x0004,
467 static const ConditionMask AnyCondition = 0x001fU;
468 static const ConditionMask UncommittedCondition = 0xffffU;
471 UnknownDiagonal = 0x0000,
472 ZeroDiagonal = 0x0001,
473 OneDiagonal = 0x0002,
474 RealDiagonal = 0x0004,
475 ImaginaryDiagonal = 0x0008
480 static const DiagonalMask AnyDiagonal = 0x000fU;
481 static const DiagonalMask UncommittedDiagonal = 0xffffU;
485 Mask() : condition(UncommittedCondition), diagonal(UncommittedDiagonal) {}
486 Mask(ConditionMask cmask, DiagonalMask dmask) : condition(cmask), diagonal(dmask) {}
488 { condition=UncommittedCondition; diagonal=UncommittedDiagonal;
return *
this;}
490 {
return condition==UncommittedCondition && diagonal==UncommittedDiagonal;}
492 {
return ((ConditionMask)actual.condition & condition) == (ConditionMask)actual.condition
493 && ((DiagonalMask) actual.diagonal & diagonal) == (DiagonalMask)actual.diagonal; }
500 {
return std::string(name(getCondition())) +
"|" + std::string(name(getDiagonal()));}
509 : condition(cond), diagonal(diag) {}
519 static ConditionMask calcMask(
Condition);
526 static DiagonalMask calcMask(
Diagonal);
531 {
return Mask(calcMask(getCondition()), calcMask(getDiagonal())); }
620 std::pair<int,int>
getSize()
const {
return std::pair<int,int>(nrow(),ncol());}
621 ptrdiff_t
nelt()
const {
return (ptrdiff_t)nrow() * (ptrdiff_t)ncol();}
626 {
return std::pair<int,int>(getLowerBandwidth(), getUpperBandwidth()); }
653 assert(lb>=0 && lb>=0);
654 lband = lb; uband = ub;
676 : nr(m), nc(n), lband(lb), uband(ub),
677 structure(structure), storage(storage),
679 condition(condition) {}
694 { assert(m>=0 && n>=0); nr = m; nc = n;
return *
this; }
696 { assert(m>=0); nr = m;
return *
this; }
698 { assert(n>=0); nc = n;
return *
this; }
755 static const SizeMask SizeUncommitted = 0xffffffffU;
757 bool isResizeable()
const {
return nr==SizeUncommitted || nc==SizeUncommitted;}
777 nr=nc=lband=uband=SizeUncommitted;
785 return nr==SizeUncommitted && nc==SizeUncommitted
786 && lband==SizeUncommitted && uband==SizeUncommitted
787 && structure.isUncommitted() && storage.isUncommitted()
788 && outline.isUncommitted() && condition.isUncommitted();
793 return isSizeOK(actual.
nr, actual.
nc)
803 {
return ((SizeMask)m & nr) == (SizeMask)m
804 && ((SizeMask)n & nc) == (SizeMask)n; }
809 {
return ((SizeMask)lower & lband) == (SizeMask)lower
810 && ((SizeMask)upper & uband) == (SizeMask)upper; }
850 { commitNumRows(m); commitNumCols(n);
return *
this; }
853 masks.nr = m;
return *
this; }
856 masks.nc = n;
return *
this; }
859 { commitLowerBandwidth(lb); commitUpperBandwidth(ub);
return *
this;}
862 masks.lband = lb;
return *
this; }
865 masks.uband = ub;
return *
this; }
868 { structure=s; masks.structure=s.
mask();
return *
this; }
870 { storage=s; masks.storage =s.
mask();
return *
this; }
872 { outline=o; masks.outline =o.
mask();
return *
this; }
874 { condition=c; masks.condition=c.
mask();
return *
this; }
886 MatrixCharacter calcDefaultCharacter(
int minNumRows,
int minNumCols)
const;
908 bool isSizeOK(
int m,
int n)
const {
return masks.isSizeOK(m,n);}
910 {
return isSizeOK(mn.first, mn.second); }
912 bool isBandwidthOK(
int lower,
int upper)
const {
return masks.isBandwidthOK(lower,upper);}
915 {
return masks.isSatisfiedBy(actual); }
917 {
return getStructureMask().isSatisfiedBy(s); }
919 {
return getStorageMask().isSatisfiedBy(s); }
921 {
return getOutlineMask().isSatisfiedBy(o); }
923 {
return getConditionMask().isSatisfiedBy(c); }
931 {
return !getStructureMask().isUncommitted(); }
933 {
return !getStorageMask().isUncommitted();}
935 {
return !getOutlineMask().isUncommitted(); }
937 {
return !getConditionMask().isUncommitted();}
941 structure.setToNone();
944 condition.setToNone();
945 masks.setToUncommitted();
953 : structure(structure), storage(storage),
954 outline(outline), condition(condition),
961 masks.structure = structure.
mask();
962 masks.storage = storage.
mask();
963 masks.outline = outline.
mask();
964 masks.condition = condition.
mask();
1101 #endif // SimTK_SIMMATRIX_MATRIX_CHARACTERISTICS_H_ const MatrixStorage::Mask & getStorageMask() const
Definition: MatrixCharacteristics.h:896
bool isBandwidthOK(int lower, int upper) const
Check whether an actual bandwidth satisfies the bandwidth commitment.
Definition: MatrixCharacteristics.h:808
MatrixOutline & updOutline()
Definition: MatrixCharacteristics.h:635
MatrixCondition & updCondition()
Definition: MatrixCharacteristics.h:636
int nrow() const
These are dimensions of the logical matrix and have nothing to do with how much storage may be used t...
Definition: MatrixCharacteristics.h:618
MatrixCommitment & commitBandwidth(int lb, int ub)
Definition: MatrixCharacteristics.h:858
MatrixCommitment & commitSize(int m, int n)
Definition: MatrixCharacteristics.h:849
Use this class to represent sets of acceptable values for each of the storage attributes (packing...
Definition: MatrixCharacteristics.h:252
Definition: MatrixCharacteristics.h:382
StructureMask structure
Definition: MatrixCharacteristics.h:157
Vector(int m)
Commit to a column vector of a particular length.
Definition: MatrixCharacteristics.h:993
PackingMask packing
Definition: MatrixCharacteristics.h:273
Matrix "outline" refers to the characteristic relationship between the number of rows and columns of ...
Definition: MatrixCharacteristics.h:376
MatrixStructure & updStructure()
Definition: MatrixCharacteristics.h:633
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:218
LapackFull(int m, int n)
Definition: MatrixCharacteristics.h:713
std::string name() const
Definition: MatrixCharacteristics.h:282
MatrixCharacter()
Default constructor sets lengths to zero and the other characteristics to "none specified".
Definition: MatrixCharacteristics.h:601
bool isNumColsLocked() const
Definition: MatrixCharacteristics.h:928
MatrixCharacter & setCondition(const MatrixCondition &ca)
Definition: MatrixCharacteristics.h:641
Mask & setToUncommitted()
Definition: MatrixCharacteristics.h:258
Packing
Definition: MatrixCharacteristics.h:205
Vector(int m)
Definition: MatrixCharacteristics.h:726
Structure
Definition: MatrixCharacteristics.h:60
bool isBandwidthOK(int lower, int upper) const
Definition: MatrixCharacteristics.h:912
MatrixStructure & setMissingAttributes()
Definition: MatrixCharacteristics.h:123
Use this class to represent a set of acceptable Condition values.
Definition: MatrixCharacteristics.h:484
MatrixStructure & setPosition(Position p)
Definition: MatrixCharacteristics.h:180
OutlineMask outline
Definition: MatrixCharacteristics.h:402
Structure getStructure() const
Definition: MatrixCharacteristics.h:175
bool isOutlineCommitted() const
Definition: MatrixCharacteristics.h:934
Placement
Definition: MatrixCharacteristics.h:220
MatrixStorage storage
Definition: MatrixCharacteristics.h:970
std::string name() const
Definition: MatrixCharacteristics.h:133
int getDefaultNumCols() const
Definition: MatrixCharacteristics.h:906
This is the default commitment for a skew Hermitian (*not* skew symmetric) matrix.
Definition: MatrixCharacteristics.h:1082
MatrixCondition::Mask condition
Definition: MatrixCharacteristics.h:819
unsigned short ConditionMask
Definition: MatrixCharacteristics.h:466
MatrixCondition & setDiagonal(Diagonal d)
Definition: MatrixCharacteristics.h:537
int nc
actual number of columns
Definition: MatrixCharacteristics.h:682
bool isSatisfiedBy(const MatrixOutline &actual) const
Definition: MatrixCharacteristics.h:399
Predefined MatrixCharacter for an ordinary column vector of a particular size.
Definition: MatrixCharacteristics.h:724
Mask(PackingMask pkm, PlacementMask plm, OrderMask om, DiagonalMask dm)
Definition: MatrixCharacteristics.h:256
MatrixCharacter & setActualNumCols(int n)
Definition: MatrixCharacteristics.h:649
Definition: MatrixCharacteristics.h:394
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
MatrixCondition & setToNone()
Restore to default-constructed state of "none".
Definition: MatrixCharacteristics.h:512
MatrixStorage & updStorage()
Definition: MatrixCharacteristics.h:634
Mask()
Definition: MatrixCharacteristics.h:485
Matrix "condition" is a statement about the numerical characteristics of a Matrix.
Definition: MatrixCharacteristics.h:454
SizeMask nr
number of rows
Definition: MatrixCharacteristics.h:812
MatrixCommitment & commitUpperBandwidth(int ub)
Definition: MatrixCharacteristics.h:863
const MatrixStructure & getStructure() const
Definition: MatrixCharacteristics.h:628
Outline
Definition: MatrixCharacteristics.h:378
int getLowerBandwidth() const
Definition: MatrixCharacteristics.h:623
unsigned short OrderMask
Definition: MatrixCharacteristics.h:236
Matrix "structure" refers to an inherent mathematical (or at least algorithmic) characteristic of the...
Definition: MatrixCharacteristics.h:58
A MatrixCharacter is a set containing a value for each of the matrix characteristics except element t...
Definition: MatrixCharacteristics.h:597
unsigned int getLowerBandwidthMask() const
Definition: MatrixCharacteristics.h:764
Matrix "storage" refers to the physical layout of data in the computer’s memory.
Definition: MatrixCharacteristics.h:203
This class collects masks of each characteristic type for representing sets of accceptable characteri...
Definition: MatrixCharacteristics.h:750
RowVector(int n)
Commit to a row vector of a particular length.
Definition: MatrixCharacteristics.h:1017
unsigned int getUpperBandwidthMask() const
Definition: MatrixCharacteristics.h:765
MatrixCommitment & commitNumRows(int m)
Definition: MatrixCharacteristics.h:851
unsigned short PositionMask
Definition: MatrixCharacteristics.h:100
ptrdiff_t nelt() const
Definition: MatrixCharacteristics.h:621
Definition: MatrixCharacteristics.h:139
bool isFullyResizeable() const
Definition: MatrixCharacteristics.h:758
MatrixStorage & setToNone()
Restore this object to its default-constructed state of "none".
Definition: MatrixCharacteristics.h:332
OrderMask order
Definition: MatrixCharacteristics.h:275
Vector()
Commit to a resizeable column vector.
Definition: MatrixCharacteristics.h:984
DiagValueMask diagValue
Definition: MatrixCharacteristics.h:159
MatrixOutline(Outline outline)
This is an implicit conversion from the Outline enum to a MatrixOutline object.
Definition: MatrixCharacteristics.h:412
bool isUncommitted() const
Definition: MatrixCharacteristics.h:398
bool isSatisfiedBy(const MatrixStorage &actual) const
Definition: MatrixCharacteristics.h:269
MatrixStructure structure
These are the commitments as specified.
Definition: MatrixCharacteristics.h:969
bool isSatisfiedBy(Structure str, Position pos, DiagValue diag) const
Definition: MatrixCharacteristics.h:149
bool isUncommitted() const
Definition: MatrixCharacteristics.h:261
Mask mask() const
Given a Structure commitment, which more-restrictive Structures will still satisfy this commitment...
Mask()
Definition: MatrixCharacteristics.h:140
MatrixCommitment & commitNumCols(int n)
Definition: MatrixCharacteristics.h:854
RowVector(int n)
Definition: MatrixCharacteristics.h:739
unsigned int SizeMask
Definition: MatrixCharacteristics.h:754
MatrixCondition(Condition cond, Diagonal diag=UnknownDiagonal)
This is an implicit conversion from the Condition enum to a MatrixCondition object.
Definition: MatrixCharacteristics.h:508
void clear()
Set commitment s to "none" and masks to "uncommitted" for all characteristics.
Definition: MatrixCharacteristics.h:940
MatrixCommitment & commitStructure(const MatrixStructure &s)
Definition: MatrixCharacteristics.h:867
MatrixStorage(Packing pk, Placement pl=NoPlacement, Order o=NoOrder, Diagonal d=NoDiag)
This constructor is also an implicit conversion from the Packing enum to a MatrixStorage object which...
Definition: MatrixCharacteristics.h:309
Predefined MatrixCharacter for an ordinary Lapack-style full matrix of a particular dimension m x n (...
Definition: MatrixCharacteristics.h:711
Order
Definition: MatrixCharacteristics.h:230
unsigned short DiagValueMask
Definition: MatrixCharacteristics.h:118
MatrixStorage & setPacking(Packing p)
Definition: MatrixCharacteristics.h:336
Packing getPacking() const
Definition: MatrixCharacteristics.h:341
const MatrixStorage & getStorageCommitment() const
Definition: MatrixCharacteristics.h:890
MatrixOutline outline
Definition: MatrixCharacteristics.h:971
static MatrixOutline calcFromSize(int m, int n)
Determine the outline from given actual dimensions.
Hermitian()
Definition: MatrixCharacteristics.h:1054
const MatrixCondition & getConditionCommitment() const
Definition: MatrixCharacteristics.h:892
Placement getPlacement() const
Definition: MatrixCharacteristics.h:342
MatrixStructure & setDiagValue(DiagValue d)
Definition: MatrixCharacteristics.h:181
MatrixCharacter & setOutline(const MatrixOutline &oa)
Definition: MatrixCharacteristics.h:640
std::string name() const
Definition: MatrixCharacteristics.h:405
bool isOutlineOK(const MatrixOutline &o) const
Definition: MatrixCharacteristics.h:920
DiagValue
For triangular, symmetric, and hermitian matrices the diagonal elements may have a single...
Definition: MatrixCharacteristics.h:110
MatrixStructure(Structure s, Position p=NoPosition, DiagValue d=NoDiagValue)
This constructor is also an implicit conversion from the Structure enum to a MatrixStructure object w...
Definition: MatrixCharacteristics.h:166
SkewSymmetric()
Definition: MatrixCharacteristics.h:1069
MatrixStorage storage
Definition: MatrixCharacteristics.h:687
This is the default commitment for a triangular matrix.
Definition: MatrixCharacteristics.h:1029
Diagonal getDiagonal() const
Definition: MatrixCharacteristics.h:344
MatrixCharacter & setStorage(const MatrixStorage &sa)
Definition: MatrixCharacteristics.h:639
bool isSizeOK(int m, int n) const
Check whether an actual size satisfies the size commitment.
Definition: MatrixCharacteristics.h:802
MatrixCharacter & setActualNumRows(int m)
Definition: MatrixCharacteristics.h:647
MatrixStructure()
Definition: MatrixCharacteristics.h:162
MatrixOutline & setToNone()
Set the outline back to its default-constructed value of "none".
Definition: MatrixCharacteristics.h:415
SizeMask uband
upper bandwidth, if banded
Definition: MatrixCharacteristics.h:814
int uband
actual upper bandwidth, if banded
Definition: MatrixCharacteristics.h:684
bool isStructureCommitted() const
Definition: MatrixCharacteristics.h:930
This is the default commitment for a row vector.
Definition: MatrixCharacteristics.h:1005
Mask(ConditionMask cmask, DiagonalMask dmask)
Definition: MatrixCharacteristics.h:486
unsigned int getNumColsMask() const
Definition: MatrixCharacteristics.h:763
int lband
actual lower bandwidth, if banded
Definition: MatrixCharacteristics.h:684
Predefined MatrixCharacter for an ordinary row vector of a particular size.
Definition: MatrixCharacteristics.h:737
int ncol() const
Definition: MatrixCharacteristics.h:619
const MatrixStorage & getStorage() const
Definition: MatrixCharacteristics.h:629
Mask mask() const
When "this" outline is used as a commitment, it represents a mask of acceptable outlines.
Definition: MatrixCharacteristics.h:424
Diagonal getDiagonal() const
Definition: MatrixCharacteristics.h:534
Mask(OutlineMask mask)
Definition: MatrixCharacteristics.h:396
This is a user-includable header which includes everything needed to make use of SimMatrix Scalar cod...
MatrixCharacter(int m, int n, int lb, int ub, MatrixStructure structure, MatrixStorage storage, MatrixCondition condition)
Definition: MatrixCharacteristics.h:671
MatrixCondition()
The default constructor sets the condition to Unknown, which is typically where it remains...
Definition: MatrixCharacteristics.h:504
MatrixCharacter & setUpperBandwidth(int ub)
Definition: MatrixCharacteristics.h:662
const MatrixCondition & getCondition() const
Definition: MatrixCharacteristics.h:631
unsigned short PackingMask
Definition: MatrixCharacteristics.h:216
std::string name() const
Definition: MatrixCharacteristics.h:499
Mask()
Definition: MatrixCharacteristics.h:752
DiagValue getDiagValue() const
Definition: MatrixCharacteristics.h:177
Mask & setToUncommitted()
Definition: MatrixCharacteristics.h:397
PlacementMask placement
Definition: MatrixCharacteristics.h:274
bool isStructureOK(const MatrixStructure &s) const
Definition: MatrixCharacteristics.h:916
bool isNumRowsLocked() const
Definition: MatrixCharacteristics.h:759
MatrixCharacter::Mask masks
These are the bitmasks of acceptable characteristics which would satisfy the above-specified commitme...
Definition: MatrixCharacteristics.h:976
MatrixCharacter & setToNone()
Restore this MatrixCharacter to its default-constructed state of "none".
Definition: MatrixCharacteristics.h:609
MatrixCharacter & setActualSize(int m, int n)
Set the actual size and update the outline to match.
Definition: MatrixCharacteristics.h:645
RowVector()
Commit to a resizeable row vector.
Definition: MatrixCharacteristics.h:1008
Mask & setToUncommitted()
Definition: MatrixCharacteristics.h:487
MatrixStorage & setMissingAttributes()
Assuming this is an actual matrix description, set any unspecified attributes to appropriate defaults...
Definition: MatrixCharacteristics.h:319
bool isNumRowsLocked() const
Definition: MatrixCharacteristics.h:927
Mask mask() const
Calculate the commitment mask associated with specifying "this" set of storage attributes as a commit...
Definition: MatrixCharacteristics.h:293
int getDefaultNumRows() const
Definition: MatrixCharacteristics.h:905
Position
For triangular matrices, we have to know which triangle we're talking about.
Definition: MatrixCharacteristics.h:93
unsigned int getNumRowsMask() const
Definition: MatrixCharacteristics.h:762
int getDefaultUpperBandwidth() const
Definition: MatrixCharacteristics.h:773
MatrixCommitment & commitOutline(const MatrixOutline &o)
Definition: MatrixCharacteristics.h:871
MatrixCommitment & commitLowerBandwidth(int lb)
Definition: MatrixCharacteristics.h:860
MatrixStorage & setOrder(Order o)
Definition: MatrixCharacteristics.h:338
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition: CompliantContactSubsystem.h:387
bool isUncommitted() const
Definition: MatrixCharacteristics.h:489
MatrixCommitment & commitCondition(const MatrixCondition &c)
Definition: MatrixCharacteristics.h:873
Diagonal
Definition: MatrixCharacteristics.h:240
MatrixCommitment & commitStorage(const MatrixStorage &s)
Definition: MatrixCharacteristics.h:869
std::pair< int, int > getBandwidth() const
Definition: MatrixCharacteristics.h:625
MatrixStorage()
Default constructor leaves all fields unspecified.
Definition: MatrixCharacteristics.h:303
bool isSizeOK(const std::pair< int, int > &mn) const
Definition: MatrixCharacteristics.h:909
Mask()
Definition: MatrixCharacteristics.h:395
DiagonalMask diagonal
Definition: MatrixCharacteristics.h:496
MatrixCharacter & setStructure(const MatrixStructure &sa)
Definition: MatrixCharacteristics.h:638
const MatrixCondition::Mask & getConditionMask() const
Definition: MatrixCharacteristics.h:898
This is a fixed-length row vector designed for no-overhead inline computation.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
bool isConditionOK(const MatrixCondition &c) const
Definition: MatrixCharacteristics.h:922
MatrixCondition & setCondition(Condition c)
Definition: MatrixCharacteristics.h:536
Definition: MatrixCharacteristics.h:381
bool isFullyResizeable() const
Definition: MatrixCharacteristics.h:926
unsigned short PlacementMask
Definition: MatrixCharacteristics.h:226
MatrixOutline::Mask outline
Definition: MatrixCharacteristics.h:818
MatrixCommitment(const MatrixStructure &str)
This is an implicit conversion from a MatrixStructure specification to a MatrixCommitment with storag...
Definition: MatrixCharacteristics.h:838
bool isStorageCommitted() const
Definition: MatrixCharacteristics.h:932
int getDefaultNumRows() const
Definition: MatrixCharacteristics.h:767
#define SimTK_SIZECHECK_NONNEG(sz, where)
Definition: ExceptionMacros.h:147
MatrixCondition condition
Definition: MatrixCharacteristics.h:972
Diagonal
Definition: MatrixCharacteristics.h:470
MatrixStorage & setDiagonal(Diagonal d)
Definition: MatrixCharacteristics.h:339
Mask()
Definition: MatrixCharacteristics.h:253
MatrixStructure & setToNone()
Definition: MatrixCharacteristics.h:186
int getDefaultLowerBandwidth() const
Definition: MatrixCharacteristics.h:772
DiagonalMask diagonal
Definition: MatrixCharacteristics.h:276
Mask & setToUncommitted()
Definition: MatrixCharacteristics.h:143
bool isUpperBandwidthLocked() const
Definition: MatrixCharacteristics.h:771
bool isUncommitted() const
Return if all fields are set to "Uncommitted" (all bits are one).
Definition: MatrixCharacteristics.h:784
This is the default commitment for skew symmetric (*not* skew Hermitian) matrix.
Definition: MatrixCharacteristics.h:1067
Mask(StructureMask sm, PositionMask pm, DiagValueMask dm)
Definition: MatrixCharacteristics.h:141
MatrixStorage(Packing pk, Order o)
This constructor is for the common case of just packing and order, with no particular placement and a...
Definition: MatrixCharacteristics.h:314
bool isSatisfiedBy(Packing pack, Placement place, Order ord, Diagonal diag) const
Definition: MatrixCharacteristics.h:264
bool isConditionCommitted() const
Definition: MatrixCharacteristics.h:936
MatrixCharacter::Mask::SizeMask getUpperBandwidthMask() const
Definition: MatrixCharacteristics.h:903
bool isLowerBandwidthLocked() const
Definition: MatrixCharacteristics.h:770
SkewHermitian()
Definition: MatrixCharacteristics.h:1084
bool isStorageOK(const MatrixStorage &s) const
Definition: MatrixCharacteristics.h:918
const MatrixStructure & getStructureCommitment() const
These report the commitment as it was specified.
Definition: MatrixCharacteristics.h:889
A MatrixCommitment provides a set of acceptable matrix characteristics.
Definition: MatrixCharacteristics.h:832
Position getPosition() const
Definition: MatrixCharacteristics.h:176
unsigned short DiagonalMask
Definition: MatrixCharacteristics.h:479
PositionMask position
Definition: MatrixCharacteristics.h:158
std::pair< int, int > getSize() const
Definition: MatrixCharacteristics.h:620
ConditionMask condition
Definition: MatrixCharacteristics.h:495
bool isResizeable() const
Definition: MatrixCharacteristics.h:757
This is the default commitment for a Hermitian (*not* symmetric) matrix.
Definition: MatrixCharacteristics.h:1052
bool isSatisfiedBy(const MatrixStructure &actual) const
Definition: MatrixCharacteristics.h:153
bool isResizeable() const
Definition: MatrixCharacteristics.h:925
Condition
Definition: MatrixCharacteristics.h:456
MatrixCharacter::Mask::SizeMask getNumColsMask() const
Definition: MatrixCharacteristics.h:901
MatrixCommitment()
Definition: MatrixCharacteristics.h:834
const MatrixOutline::Mask & getOutlineMask() const
Definition: MatrixCharacteristics.h:897
This is the default commitment for a symmetric (*not* Hermitian) matrix.
Definition: MatrixCharacteristics.h:1040
const MatrixOutline & getOutlineCommitment() const
Definition: MatrixCharacteristics.h:891
bool isSatisfiedBy(const MatrixCharacter &actual) const
Definition: MatrixCharacteristics.h:914
MatrixCharacter::Mask::SizeMask getLowerBandwidthMask() const
Definition: MatrixCharacteristics.h:902
Condition getCondition() const
Definition: MatrixCharacteristics.h:533
bool isSizeOK(int m, int n) const
Definition: MatrixCharacteristics.h:908
MatrixCondition condition
Definition: MatrixCharacteristics.h:689
int nr
actual number of rows
Definition: MatrixCharacteristics.h:682
MatrixStorage & setPlacement(Placement p)
Definition: MatrixCharacteristics.h:337
MatrixStorage::Mask storage
Definition: MatrixCharacteristics.h:817
MatrixCharacter::Mask::SizeMask getNumRowsMask() const
Definition: MatrixCharacteristics.h:900
MatrixStructure & setStructure(Structure s)
Definition: MatrixCharacteristics.h:179
unsigned short DiagonalMask
Definition: MatrixCharacteristics.h:246
MatrixOutline outline
Definition: MatrixCharacteristics.h:688
bool isNumColsLocked() const
Definition: MatrixCharacteristics.h:760
MatrixStructure::Mask structure
Definition: MatrixCharacteristics.h:816
Triangular()
Definition: MatrixCharacteristics.h:1031
bool isSatisfiedBy(const MatrixCharacter &actual) const
Check whether an actual matrix character satisfies this matrix commitment.
Definition: MatrixCharacteristics.h:792
MatrixCharacter & setBandwidth(int lb, int ub)
Definition: MatrixCharacteristics.h:652
Mask mask() const
Return the commitment mask corresponding to use of "this" condition as a commitment.
Definition: MatrixCharacteristics.h:530
MatrixOutline()
Default constructor produces an object containing no outline specification.
Definition: MatrixCharacteristics.h:409
bool isSatisfiedBy(const MatrixCondition &actual) const
Definition: MatrixCharacteristics.h:491
const MatrixOutline & getOutline() const
Definition: MatrixCharacteristics.h:630
int getUpperBandwidth() const
Definition: MatrixCharacteristics.h:624
MatrixStructure structure
Definition: MatrixCharacteristics.h:686
Symmetric()
Definition: MatrixCharacteristics.h:1042
Outline getOutline() const
Return the outline value stored in this MatrixOutline object.
Definition: MatrixCharacteristics.h:436
MatrixCommitment(const MatrixStructure &structure, const MatrixStorage &storage, const MatrixOutline &outline, const MatrixCondition &condition)
Definition: MatrixCharacteristics.h:949
This is the default commitment for a column vector.
Definition: MatrixCharacteristics.h:981
MatrixCharacter & setLowerBandwidth(int lb)
Definition: MatrixCharacteristics.h:657
Definition: MatrixCharacteristics.h:380
Mask & setToUncommitted()
Set all bits to one ("Uncommitted").
Definition: MatrixCharacteristics.h:776
unsigned short OutlineMask
Definition: MatrixCharacteristics.h:390
int getDefaultNumCols() const
Definition: MatrixCharacteristics.h:768
Order getOrder() const
Definition: MatrixCharacteristics.h:343
const MatrixStructure::Mask & getStructureMask() const
These report the masks of acceptable values generated from the commitment.
Definition: MatrixCharacteristics.h:895
bool isUncommitted() const
Definition: MatrixCharacteristics.h:146
unsigned int StructureMask
Definition: MatrixCharacteristics.h:84