MGCL V10
V10
MGCL V10
|
Defines non-decreasing double data array. [詳解]
公開メンバ関数 | |
MGNDDArray () | |
void constructor. [詳解] | |
MGNDDArray (int n, const double *data=0) | |
Constructor MGNDDArray of size n and lenght=n. [詳解] | |
MGNDDArray (int n, double init, double increment=1.0) | |
MGNDDArray (const MGBPointSeq &) | |
From Data Point ordinate, obtain data point seq abscissa. [詳解] | |
MGNDDArray (MGENDCOND begin, MGENDCOND end, const MGBPointSeq &) | |
MGNDDArray (MGENDCOND begin, MGENDCOND end, const MGKnotVector &t) | |
MGNDDArray (const MGNDDArray &, int nnew) | |
MGNDDArray (const MGNDDArray &, double ts, double te) | |
MGNDDArray (int start_id, int num, const MGNDDArray &array2) | |
Construct by extracting sub interval of array2. [詳解] | |
MGNDDArray (int id1, int num1, const MGNDDArray &array1, int id2, int num2, const MGNDDArray &array2) | |
MGNDDArray (const MGNDDArray &nd) | |
Copy constructor. [詳解] | |
virtual | ~MGNDDArray () |
double | operator[] (int i) const |
Access to i-th element. [詳解] | |
double | operator() (int i) const |
double & | operator[] (int i) |
Access to i-th element. [詳解] | |
double & | operator() (int i) |
MGNDDArray & | operator= (const MGNDDArray &vec2) |
Assignment. [詳解] | |
MGNDDArray | operator+ (double) const |
MGNDDArray & | operator+= (double) |
MGNDDArray | operator- (double) const |
MGNDDArray & | operator-= (double) |
MGNDDArray | operator- () const |
MGNDDArray | operator* (double scale) const |
Scaling. [詳解] | |
MGNDDArray & | operator*= (double scale) |
bool | operator== (const MGNDDArray &t2) const |
Copmarison operator. [詳解] | |
bool | operator!= (const MGNDDArray &t2) const |
int | add_data (double value, int mult_max=1) |
int | add_data (const MGKnot &knot, int mult_max) |
void | copy_removing_multi (int start_id, int num, const MGNDDArray &array2) |
Copy data points from array by removing the mltiple knot. [詳解] | |
const double * | data (int i=0) const |
Return a pointer to raw data of MGNDDArray. [詳解] | |
double * | data (int i=0) |
Return a pointer to raw data of MGNDDArray. [詳解] | |
int | del_data (int index) |
bool | is_null () const |
Test if this is null. [詳解] | |
int | length () const |
Return the length of MGNDDArray. [詳解] | |
void | set_length (int length) |
Set the length of effective data. [詳解] | |
virtual void | set_null () |
Set this as a null NDDArray. [詳解] | |
void | store_with_capacityCheck (int i, double data) |
virtual int | locate (double tau) const |
virtual int | locate_multi (int start, int multi, int &index) const |
virtual void | change_range (double ts, double te) |
MGNDDArray & | change_number (int nnew) |
double | ref (int i) const |
Reference to i-th element. [詳解] | |
void | remove_too_near (bool allow_multi=false, double ratio=6.) |
Remove too near data points. [詳解] | |
void | remove_too_near (MGBPointSeq &ordinates, bool allow_multi=false, double ratio=6.) |
Remove too near data points. Removal will be done with the ordinates. [詳解] | |
void | reshape (int size, int start=0) |
void | resize (int nsize) |
int | capacity () const |
Return the size of MGNDDArray. [詳解] | |
MGNDDArray & | update_from_knot (const MGKnotVector &t) |
Obtain data point from KnotVector t and replace own with it. [詳解] | |
virtual int | dump_size () const |
virtual int | dump (MGOfstream &) const |
Dump Function. [詳解] | |
virtual int | restore (MGIfstream &) |
Restore Function. [詳解] | |
限定公開変数類 | |
int | m_current |
current interval of the array is held. [詳解] | |
フレンド | |
MG_DLL_DECLR friend MGNDDArray | operator* (double scale, const MGNDDArray &nd) |
Friend Function. [詳解] | |
MG_DLL_DECLR friend std::ostream & | operator<< (std::ostream &, const MGNDDArray &) |
String stream Function. [詳解] | |
Defines non-decreasing double data array.
Used for data point abscissa, or knot vector, etc. MGNDDArray has size and effective data length.
|
inline |
void constructor.
|
explicit |
Constructor MGNDDArray of size n and lenght=n.
n | size of this. |
data | data array of length n if data!=NULL. |
MGNDDArray::MGNDDArray | ( | int | n, |
double | init, | ||
double | increment = 1.0 |
||
) |
Construct MGNDDArray so that initial data is init and is incremented by increment.
|
explicit |
From Data Point ordinate, obtain data point seq abscissa.
MGNDDArray::MGNDDArray | ( | MGENDCOND | begin, |
MGENDCOND | end, | ||
const MGBPointSeq & | |||
) |
From Data Point ordinate with End condition, obtain data point seq abscissa.
MGNDDArray::MGNDDArray | ( | MGENDCOND | begin, |
MGENDCOND | end, | ||
const MGKnotVector & | t | ||
) |
From knot vector with End conditions, obtain data point seq abscissa. This data point can be input of MGSBRep constructor of the following form: MGSBRep::MGSBRep( MGSBRepEndC& endc,///end condition const MGNDDArray& utaui, ///Data point of u-direction const MGNDDArray& vtaui, ///Data point of v-direction const MGSPointSeq& value, ///Data point ordinate const MGKnotVector& tu, ///knot vector of u-direction, of order 4 const MGKnotVector& tv, ///knot vector of v-direction, of order 4 int &error) ///Error flag. That is, generate utaui or vtaui from tu or tv each, taking endc into account. The order is assumed to be 4.
MGNDDArray::MGNDDArray | ( | const MGNDDArray & | , |
int | nnew | ||
) |
From data point, obtain data point of updated number(nnew). If original data point has multiplicities and nnew>=length(), original data point parameters and the multiplicities are preserved. Same as change_number().
MGNDDArray::MGNDDArray | ( | const MGNDDArray & | , |
double | ts, | ||
double | te | ||
) |
From data point, obtain data point of updated value range. Update so that (*this)(0)=ts, and (*this)(lenght()-1)=te. Must be ts<te.
MGNDDArray::MGNDDArray | ( | int | start_id, |
int | num, | ||
const MGNDDArray & | array2 | ||
) |
Construct by extracting sub interval of array2.
start_id | Start id of array2(from 0). |
num | new array length. |
array2 | Original NDDArray. |
MGNDDArray::MGNDDArray | ( | int | id1, |
int | num1, | ||
const MGNDDArray & | array1, | ||
int | id2, | ||
int | num2, | ||
const MGNDDArray & | array2 | ||
) |
Construct by mixing two arrays. Mixing is so done as that no too close points are included. Although data point multiplicities of array1 are preserved, multiplicities of array2 are not. DATA POINT MULTIPLICITY IS ALLOWED ONLY IN array1.
id1 | Start id of array1(from 0). |
num1 | new array length to use of array1. |
array1 | Original NDDArray1. |
id2 | Start id of array2(from 0). |
num2 | new array length to use of array2.. |
array2 | Original NDDArray2. |
MGNDDArray::MGNDDArray | ( | const MGNDDArray & | nd | ) |
Copy constructor.
|
inlinevirtual |
int MGNDDArray::add_data | ( | double | value, |
int | mult_max = 1 |
||
) |
Add data of multiplicity 1 into data points. mult_max is the maximum multiplicity allowed for NDDArray. Return value is number of data actually added.
int MGNDDArray::add_data | ( | const MGKnot & | knot, |
int | mult_max | ||
) |
Add data with multiplicity into data points. mult_max is the maximum multiplicity allowed. Return value is number of data actually added.
|
inline |
Return the size of MGNDDArray.
MGNDDArray& MGNDDArray::change_number | ( | int | nnew | ) |
Update array length. Updated array is so generated that the original proportions of neighbors hold as much as possible. If original data point has multiplicities and nnew>=length(), original data point parameters and the multiplicities are preserved.
|
virtual |
Update so that (*this)(0)=ts, and (*this)(lenght()-1)=te. Must be ts<te.
MGKnotVectorで再実装されています。
void MGNDDArray::copy_removing_multi | ( | int | start_id, |
int | num, | ||
const MGNDDArray & | array2 | ||
) |
Copy data points from array by removing the mltiple knot.
start_id | Start id of array2(from 0). |
num | new array length from start_id |
array2 | Original NDDArray. |
|
inline |
Return a pointer to raw data of MGNDDArray.
|
inline |
Return a pointer to raw data of MGNDDArray.
int MGNDDArray::del_data | ( | int | index | ) |
Delete one data at index. Return value is new total number of data in the array, generally is original_length()-1.
|
virtual |
Dump Function.
MGKnotVectorで再実装されています。
|
virtual |
Dump Functions. Calculate dump size
MGKnotVectorで再実装されています。
|
inline |
Test if this is null.
|
inline |
Return the length of MGNDDArray.
|
virtual |
Finds index where tau is located in MGNDDArray as an index of knot: tau < (*this)(0) : index=-1. (*this)(0) <= tau< (*this)(n-1) : 0<= index <n-1, such that (*this)(index) <= tau < (*this)(index+1) (*this)(n-1) <= tau : index=n-1. Here n=lenght().
MGKnotVectorで再実装されています。
|
virtual |
Locate where data of multiplicity of multi is after start. index is the starting point index of this found first after start. index>=start if index>=0. Function's return value locate_multi is actual multiplicity at the index, i.e. locate_multi>=multi. If position of the multiplicity is not found to the end, index=(lenght()-1) (index of the last element) and locate_multi=0 will be returned. multi must be >=1.
MGKnotVectorで再実装されています。
|
inline |
|
inline |
|
inline |
MGNDDArray MGNDDArray::operator* | ( | double | scale | ) | const |
Scaling.
MGNDDArray& MGNDDArray::operator*= | ( | double | scale | ) |
MGNDDArray MGNDDArray::operator+ | ( | double | ) | const |
Addition and subtraction of real number. All of the elements will be added or subtracted.
MGNDDArray& MGNDDArray::operator+= | ( | double | ) |
MGNDDArray MGNDDArray::operator- | ( | double | ) | const |
MGNDDArray MGNDDArray::operator- | ( | ) | const |
単項マイナス。 Unary minus. Reverse the ordering of elements by changing all of the signs.
MGNDDArray& MGNDDArray::operator-= | ( | double | ) |
MGNDDArray& MGNDDArray::operator= | ( | const MGNDDArray & | vec2 | ) |
Assignment.
bool MGNDDArray::operator== | ( | const MGNDDArray & | t2 | ) | const |
Copmarison operator.
|
inline |
Access to i-th element.
|
inline |
Access to i-th element.
|
inline |
Reference to i-th element.
void MGNDDArray::remove_too_near | ( | bool | allow_multi = false , |
double | ratio = 6. |
||
) |
Remove too near data points.
allow_multi | indicates if multiple data point is allowed or not, when allow_multi=false, multiple data points will be removed, when allow_multi=true, will not be removed. |
ratio | maximum ratio allowed for neighboring span, let ti=(*this)[i], then if (t(i+1)-ti)/(ti-t(i-1))>ratio or (t(i+1)-ti)/(ti-t(i-1))<1/ratio, a data point will be removed(along with the ordinates). |
void MGNDDArray::remove_too_near | ( | MGBPointSeq & | ordinates, |
bool | allow_multi = false , |
||
double | ratio = 6. |
||
) |
Remove too near data points. Removal will be done with the ordinates.
ordinates | ordinate, ordinates.length() must be equal to this->length(). |
allow_multi | indicates if multiple data point is allowed or not, when allow_multi=false, multiple data points will be removed, when allow_multi=true, will not be removed. |
ratio | maximum ratio allowed for neighboring span, let ti=(*this)[i], then if (t(i+1)-ti)/(ti-t(i-1))>ratio or (t(i+1)-ti)/(ti-t(i-1))<1/ratio, a data point will be removed(along with the ordinates). |
void MGNDDArray::reshape | ( | int | size, |
int | start = 0 |
||
) |
Change the size. start is to indicate from which location of new area to start storing. Although size can be less than original length, some of end data will be lost in this case. When 'start'>0, first 'start' data will be garbage. Original data will be held as long as the storage permits.
void MGNDDArray::resize | ( | int | nsize | ) |
Resize the array. Result will contain garbages. length() and size() will have nsize.
|
virtual |
Restore Function.
MGKnotVectorで再実装されています。
void MGNDDArray::set_length | ( | int | length | ) |
Set the length of effective data.
|
virtual |
Set this as a null NDDArray.
MGKnotVectorで再実装されています。
void MGNDDArray::store_with_capacityCheck | ( | int | i, |
double | data | ||
) |
store data at the position i of this array. tau(i) must be => tau(i-1). When i>=capacity(), reshape will take place. The data validity after i is not checked.
i | the postion to store at. |
data | the data to store. |
MGNDDArray& MGNDDArray::update_from_knot | ( | const MGKnotVector & | t | ) |
Obtain data point from KnotVector t and replace own with it.
|
friend |
Friend Function.
|
friend |
String stream Function.
|
mutableprotected |
current interval of the array is held.