HDK
|
#include <GA_NUBBasis.h>
Public Types | |
typedef T | value_type |
Public Attributes | |
const UT_JobInfo & | info |
const UT_VectorT< T > & | v |
const UT_VectorT< T > const UT_JobInfo & | info |
const UT_VectorT< T > & | b |
Protected Attributes | |
int | type |
int const UT_JobInfo &info | const |
const UT_VectorT< T > const UT_JobInfo &info | const |
const UT_VectorT< T > fpreal64 * | norm2 |
const UT_VectorT< T > fpreal64 const UT_JobInfo & | info |
const UT_VectorT< T > fpreal64 exint | normlimit |
const UT_VectorT< T > fpreal64 exint const UT_JobInfo & | info |
const UT_VectorT< T > fpreal64 * | dot_aba |
const UT_VectorT< T > fpreal64 exint | dotlimit |
Static Protected Attributes | |
static const exint | PARALLEL_BLOCK_SIZE = 1024 |
Friends | |
std::ostream & | operator<< (std::ostream &os, const UT_VectorT< T > &v) |
Definition at line 29 of file GA_NUBBasis.h.
typedef T UT_VectorT< T >::value_type |
Definition at line 35 of file UT_Vector.h.
|
inline |
Input the index range [nl..nh].
Definition at line 38 of file UT_Vector.h.
UT_VectorT< T >::UT_VectorT | ( | exint | nl, |
exint | nh | ||
) |
Definition at line 36 of file UT_Vector.C.
UT_VectorT< T >::UT_VectorT | ( | const UT_VectorT< T > & | v | ) |
Definition at line 44 of file UT_Vector.C.
UT_VectorT< T >::~UT_VectorT | ( | ) |
Definition at line 53 of file UT_Vector.C.
void UT_VectorT< T >::addScaledVecNorm2 | ( | T | s, |
const UT_VectorT< T > & | v, | ||
fpreal64 * | norm2 | ||
) |
Add scaled vector and compute the squared L2 norm.
Definition at line 503 of file UT_Vector.C.
void UT_VectorT< T >::addScaledVecNorm2UpTo | ( | T | s, |
const UT_VectorT< T > & | v, | ||
fpreal64 * | norm2, | ||
exint | normlimit | ||
) |
Add scaled vector and compute the squared L2 norm, but only using components up to (but excluding) index normlimit for the norm computation.
Definition at line 562 of file UT_Vector.C.
Assign from a float array into the designated subvector, performing a deep copy.
Definition at line 91 of file UT_Vector.C.
Definition at line 99 of file UT_Vector.C.
void UT_VectorT< T >::changeNL | ( | exint | nl | ) |
Change the low index, and the high index will adjust itself.
Definition at line 267 of file UT_Vector.C.
|
inline |
Initialize to the given constant.
Definition at line 63 of file UT_Vector.h.
Definition at line 203 of file UT_Vector.C.
Definition at line 184 of file UT_Vector.C.
Definition at line 193 of file UT_Vector.C.
|
protected |
Definition at line 168 of file UT_Vector.C.
T UT_VectorT< T >::distance2 | ( | const UT_VectorT< T > & | v | ) | const |
Definition at line 390 of file UT_Vector.C.
T UT_VectorT< T >::dot | ( | const UT_VectorT< T > & | v | ) | const |
Definition at line 906 of file UT_Vector.C.
|
inline |
Definition at line 240 of file UT_Vector.h.
|
inline |
Get the high index.
Definition at line 82 of file UT_Vector.h.
|
inline |
Get the low index.
Definition at line 79 of file UT_Vector.h.
void UT_VectorT< T >::getPartialBlockRange | ( | exint & | startblock, |
exint & | endblock, | ||
const exint | blocksize, | ||
const UT_JobInfo & | info | ||
) | const |
Determines the [startblock,endblock) interval that should be worked on, where block 0 starts at myNL and all blocks are blocksize long, except possibly the last.
Definition at line 146 of file UT_Vector.C.
void UT_VectorT< T >::getPartialRange | ( | exint & | start, |
exint & | end, | ||
const UT_JobInfo & | info | ||
) | const |
Determines the [start,end) interval that should be worked on.
Definition at line 136 of file UT_Vector.C.
void UT_VectorT< T >::getSubvector2 | ( | UT_Vector2 & | v, |
exint | idx | ||
) | const |
These methods allow one to read out and write into subvectors of UT_Vector using our other vector classes. Keep in mind that the usual UT_Vector? methods are 0 based, while this class is usually 1 based.
Definition at line 213 of file UT_Vector.C.
void UT_VectorT< T >::getSubvector3 | ( | UT_Vector3 & | v, |
exint | idx | ||
) | const |
Definition at line 229 of file UT_Vector.C.
void UT_VectorT< T >::getSubvector4 | ( | UT_Vector4 & | v, |
exint | idx | ||
) | const |
Definition at line 247 of file UT_Vector.C.
bool UT_VectorT< T >::hasNan | ( | ) | const |
Definition at line 975 of file UT_Vector.C.
void UT_VectorT< T >::init | ( | exint | nl, |
exint | nh | ||
) |
Initialize nl, nh and allocate space.
Definition at line 107 of file UT_Vector.C.
bool UT_VectorT< T >::isEqual | ( | const UT_VectorT< T > & | v, |
int64 | ulps | ||
) |
Equals upls is the number of representable fpreal64's to accept between each individual component. If you deal in fpreal32's and assign into this fpreal64 class, then you will want a ulps that is scaled by 2^32. eg. for 50upls at fpreal32 precision, you will need 50*2^32 or approximately 1e+11.
Definition at line 961 of file UT_Vector.C.
|
inline |
Definition at line 54 of file UT_Vector.h.
|
inline |
Get dimension of this vector.
Definition at line 85 of file UT_Vector.h.
void UT_VectorT< T >::multSetAndDotUpTo | ( | const UT_VectorT< T > & | a, |
const UT_VectorT< T > & | b, | ||
fpreal64 * | dot_aba, | ||
exint | dotlimit | ||
) |
Multiply two sources together, save to this. Requires that three vectors already have the same size. Computes dot(a*b, a) This strange seeming pair is useful for jacobian preconditioners.
Definition at line 674 of file UT_Vector.C.
void UT_VectorT< T >::negPartial | ( | const UT_JobInfo & | info | ) |
Negate.
Definition at line 436 of file UT_Vector.C.
|
inline |
Definition at line 1004 of file UT_Vector.C.
T UT_VectorT< T >::norm | ( | int | type = 2 | ) | const |
Lp-norm type: 0 L-infinity norm (ie. max abs) 1 L1-norm (ie. sum of abs) 2 L2-norm (ie. Euclidean distance)
Definition at line 278 of file UT_Vector.C.
T UT_VectorT< T >::norm2 | ( | ) | const |
Square of L2-norm.
|
inline |
For retrieving data.
Definition at line 115 of file UT_Vector.h.
|
inline |
Definition at line 120 of file UT_Vector.h.
UT_VectorT< T > & UT_VectorT< T >::operator*= | ( | const UT_VectorT< T > & | v | ) |
Componentwise multiplication & division.
Definition at line 859 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator*= | ( | T | scalar | ) |
Scalar multiplication and division.
Definition at line 881 of file UT_Vector.C.
|
inline |
Definition at line 1221 of file UT_Vector.C.
|
inline |
Definition at line 1237 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator+= | ( | const UT_VectorT< T > & | v | ) |
Definition at line 837 of file UT_Vector.C.
|
inline |
Definition at line 1205 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator-= | ( | const UT_VectorT< T > & | v | ) |
Definition at line 848 of file UT_Vector.C.
|
inline |
Definition at line 1213 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator/= | ( | const UT_VectorT< T > & | v | ) |
Definition at line 870 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator/= | ( | T | scalar | ) |
Definition at line 893 of file UT_Vector.C.
|
inline |
Definition at line 1229 of file UT_Vector.C.
|
inline |
Definition at line 1245 of file UT_Vector.C.
UT_VectorT< T > & UT_VectorT< T >::operator= | ( | const UT_VectorT< T > & | v | ) |
Operators NOTE: operator= requires the destination be a matching size and layout!
Definition at line 814 of file UT_Vector.C.
std::ostream & UT_VectorT< T >::save | ( | std::ostream & | os | ) | const |
Definition at line 949 of file UT_Vector.C.
|
inline |
Definition at line 112 of file UT_Vector.h.
|
inline |
Change the indices in a very shallow manner, i.e. simply change the index without shifting the data. This is highly dangerous, yet very useful if used with care.
Definition at line 111 of file UT_Vector.h.
void UT_VectorT< T >::setSubvector2 | ( | exint | idx, |
const UT_Vector2 & | v | ||
) |
Definition at line 221 of file UT_Vector.C.
void UT_VectorT< T >::setSubvector3 | ( | exint | idx, |
const UT_Vector3 & | v | ||
) |
Definition at line 238 of file UT_Vector.C.
void UT_VectorT< T >::setSubvector4 | ( | exint | idx, |
const UT_Vector4 & | v | ||
) |
Definition at line 257 of file UT_Vector.C.
|
inline |
Determines if we have a large enough vector to make micro threading worthwhile. Experimentation shows with 4 procs on NT, 5000 is a cut off for good behaviour on the simplistic addScaledVec method.
Definition at line 91 of file UT_Vector.h.
void UT_VectorT< T >::subvector | ( | const UT_VectorT< T > & | v, |
exint | nl, | ||
exint | nh | ||
) |
Steal from another vector, resulting vector has origin at 1.
Definition at line 61 of file UT_Vector.C.
void UT_VectorT< T >::testForNan | ( | ) | const |
Definition at line 987 of file UT_Vector.C.
UT_VectorT< T >::THREADED_METHOD1 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
negPlus | , | ||
const UT_VectorT< T > & | , | ||
v | |||
) | const |
UT_VectorT< T >::THREADED_METHOD1 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
safeInvertAndSet | , | ||
const UT_VectorT< T > & | , | ||
a | |||
) | const |
Inverts the source and saves to this. Requires that the vectors match.
UT_VectorT< T >::THREADED_METHOD1 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
invertAndSet | , | ||
const UT_VectorT< T > & | , | ||
a | |||
) | const |
UT_VectorT< T >::THREADED_METHOD1 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
copyFrom | , | ||
const UT_VectorT< T > & | , | ||
v | |||
) | const |
Multithreaded copy. operator= uses this.
UT_VectorT< T >::THREADED_METHOD2 | ( | UT_VectorT< T > | , |
nh- | nl, | ||
4999 | , | ||
zero | , | ||
exint | , | ||
nl | , | ||
exint | , | ||
nh | |||
) |
UT_VectorT< T >::THREADED_METHOD2 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
addScaledVec | , | ||
T | , | ||
s | , | ||
const UT_VectorT< T > & | , | ||
v | |||
) |
Add scaled vector.
UT_VectorT< T >::THREADED_METHOD2 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
scaleAddVec | , | ||
T | , | ||
s | , | ||
const UT_VectorT< T > & | , | ||
v | |||
) |
Scale itself then add vector.
UT_VectorT< T >::THREADED_METHOD2 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
multAndSet | , | ||
const UT_VectorT< T > & | , | ||
a | , | ||
const UT_VectorT< T > & | , | ||
b | |||
) | const |
Multiply two sources together, save to this. Requires that three vectors already have the same size.
UT_VectorT< T >::THREADED_METHOD2 | ( | UT_VectorT< T > | , |
shouldMultiThread() | , | ||
divAndSet | , | ||
const UT_VectorT< T > & | , | ||
a | , | ||
const UT_VectorT< T > & | , | ||
b | |||
) | const |
Divides two sources together, save to this. Requires that three vectors already have the same size.
|
protected |
A multithreaded norm function that returns the non-normalized norm (Ie, squared in the L2 case.) and is mulithreaded.
|
protected |
|
protected |
A multithreaded dot method.
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Initialize to zeros.
Definition at line 57 of file UT_Vector.h.
void UT_VectorT< T >::zeroPartial | ( | exint | nl, |
exint | nh, | ||
const UT_JobInfo & | info | ||
) |
Definition at line 155 of file UT_Vector.C.
|
friend |
Definition at line 237 of file UT_Vector.h.
const UT_VectorT< T > & UT_VectorT< T >::b |
Definition at line 172 of file UT_Vector.h.
|
protected |
Definition at line 251 of file UT_Vector.h.
|
protected |
Definition at line 256 of file UT_Vector.h.
|
protected |
Definition at line 287 of file UT_Vector.h.
|
protected |
Definition at line 287 of file UT_Vector.h.
const UT_VectorT< T > fpreal64 exint const UT_JobInfo & UT_VectorT< T >::info |
Definition at line 142 of file UT_Vector.h.
const UT_VectorT<T> const UT_JobInfo& UT_VectorT< T >::info |
Definition at line 148 of file UT_Vector.h.
|
protected |
Definition at line 270 of file UT_Vector.h.
|
protected |
Definition at line 278 of file UT_Vector.h.
|
protected |
Definition at line 270 of file UT_Vector.h.
|
protected |
Definition at line 278 of file UT_Vector.h.
|
staticprotected |
Definition at line 295 of file UT_Vector.h.
|
protected |
Definition at line 251 of file UT_Vector.h.
const UT_VectorT< T > & UT_VectorT< T >::v |
Definition at line 148 of file UT_Vector.h.