MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
MGNDDArray クラス

Defines non-decreasing double data array. [詳解]

MGNDDArray の継承関係図
MGKnotVector

公開メンバ関数

 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)
 
MGNDDArrayoperator= (const MGNDDArray &vec2)
 Assignment. [詳解]
 
MGNDDArray operator+ (double) const
 
MGNDDArrayoperator+= (double)
 
MGNDDArray operator- (double) const
 
MGNDDArrayoperator-= (double)
 
MGNDDArray operator- () const
 
MGNDDArray operator* (double scale) const
 Scaling. [詳解]
 
MGNDDArrayoperator*= (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)
 
MGNDDArraychange_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. [詳解]
 
MGNDDArrayupdate_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.

構築子と解体子

MGNDDArray::MGNDDArray ( )
inline

void constructor.

MGNDDArray::MGNDDArray ( int  n,
const double *  data = 0 
)
explicit

Constructor MGNDDArray of size n and lenght=n.

引数
nsize of this.
datadata 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.

MGNDDArray::MGNDDArray ( const MGBPointSeq )
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_idStart id of array2(from 0).
numnew array length.
array2Original 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.

引数
id1Start id of array1(from 0).
num1new array length to use of array1.
array1Original NDDArray1.
id2Start id of array2(from 0).
num2new array length to use of array2..
array2Original NDDArray2.
MGNDDArray::MGNDDArray ( const MGNDDArray nd)

Copy constructor.

virtual MGNDDArray::~MGNDDArray ( )
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.

int MGNDDArray::capacity ( ) const
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 void MGNDDArray::change_range ( double  ts,
double  te 
)
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_idStart id of array2(from 0).
numnew array length from start_id
array2Original NDDArray.
const double* MGNDDArray::data ( int  i = 0) const
inline

Return a pointer to raw data of MGNDDArray.

double* MGNDDArray::data ( int  i = 0)
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 int MGNDDArray::dump ( MGOfstream ) const
virtual

Dump Function.

MGKnotVectorで再実装されています。

virtual int MGNDDArray::dump_size ( ) const
virtual

Dump Functions. Calculate dump size

MGKnotVectorで再実装されています。

bool MGNDDArray::is_null ( ) const
inline

Test if this is null.

int MGNDDArray::length ( ) const
inline

Return the length of MGNDDArray.

virtual int MGNDDArray::locate ( double  tau) const
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 int MGNDDArray::locate_multi ( int  start,
int  multi,
int &  index 
) const
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で再実装されています。

bool MGNDDArray::operator!= ( const MGNDDArray t2) const
inline
double MGNDDArray::operator() ( int  i) const
inline
double& MGNDDArray::operator() ( int  i)
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.

double MGNDDArray::operator[] ( int  i) const
inline

Access to i-th element.

double& MGNDDArray::operator[] ( int  i)
inline

Access to i-th element.

double MGNDDArray::ref ( int  i) const
inline

Reference to i-th element.

void MGNDDArray::remove_too_near ( bool  allow_multi = false,
double  ratio = 6. 
)

Remove too near data points.

引数
allow_multiindicates 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.
ratiomaximum 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.

引数
ordinatesordinate, ordinates.length() must be equal to this->length().
allow_multiindicates 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.
ratiomaximum 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 int MGNDDArray::restore ( MGIfstream )
virtual

Restore Function.

MGKnotVectorで再実装されています。

void MGNDDArray::set_length ( int  length)

Set the length of effective data.

virtual void MGNDDArray::set_null ( )
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.

引数
ithe postion to store at.
datathe data to store.
MGNDDArray& MGNDDArray::update_from_knot ( const MGKnotVector t)

Obtain data point from KnotVector t and replace own with it.

フレンドと関連関数の詳解

MG_DLL_DECLR friend MGNDDArray operator* ( double  scale,
const MGNDDArray nd 
)
friend

Friend Function.

MG_DLL_DECLR friend std::ostream& operator<< ( std::ostream &  ,
const MGNDDArray  
)
friend

String stream Function.

メンバ詳解

int MGNDDArray::m_current
mutableprotected

current interval of the array is held.


このクラス詳解は次のファイルから抽出されました: