System CATRawColldouble
Usage: you must use this class as is. You should never derive it.
public class CATRawColldouble
Class to implement a mutable list of double-precision floating-point numbers.
Role: The purpose of this class is to let C++ classes easily pass and
receive lists of double. The class handles all the low-level
memory allocation tasks such as reallocating the list once it capacity has
been exceeded. It also provides high level operations such as sorting,
comparison, etc... The first element has index 1.
Use the type
Constructor and Destructor Index
- o
CATRawColldouble(int)
- Constructs an empty list of doubles.
- o
CATRawColldouble(double*,int)
- Constructs a list and initializes it with a C++ double array.
- o
CATRawColldouble(CATRawColldouble&)
- Copy constructor.
- o
~CATRawColldouble()
- Destructor.
Method Index
- o
Append(double)
- Appends a double to the list.
- o
Append(CATRawColldouble&)
- Appends the content of a double list.
- o
Compare(CATRawColldouble&,CATRawColldouble&)
- Compares two lists of doubles.
- o
FillArray(double*,int)
- Fills a C++ array of doubles with elements from the list.
- o
InsertAt(int,double)
- Inserts a double within the list at the specified index.
- o
Intersection(CATRawColldouble&,CATRawColldouble&,CATRawColldouble&)
- Computes the intersection of two lists.
- o
Locate(double,int)
- Finds the first occurrence of a double from a given index.
- o
NbOccur(double)
- Counts the occurrences of a double in the list.
- o
QuickSort()
- Sorts the list using the quicksort algorithm.
- o
Remove(CATRawColldouble&)
- Removes all the values specifed in iSubstract from the list.
- o
RemoveAll(CATCollec::MemoryHandling)
- Removes all the elements from the list.
- o
RemoveDuplicates(CATRawColldouble*)
- Removes all the duplicate occurrences of a double from the list and
appends them to another list.
- o
RemoveNulls()
- Removes all the doubles equal to 0.
- o
RemovePosition(int)
- Removes the double located at a given index.
- o
RemovePosition(int,unsigned int)
- Removes several doubles from the starting given index.
- o
RemoveValue(double)
- Removes the first occurrence of a double from the list.
- o
Size()
- Returns the size of the list.
- o
Size(int)
- Forces the size of the list to an arbitrary size.
- o
Size(int,double)
- Forces the size of the list to an arbitrary size.
- o
Swap(int,int)
- Swaps two list elements.
- o
operator !=(CATRawColldouble&)
- Inequality operator.
- o
operator =(CATRawColldouble&)
- Assignment operator.
- o
operator ==(CATRawColldouble&)
- Equality operator.
- o
operator[](int)
- Subscripting operator.
- o
operator[](int)
- Subscripting operator.
Constructor and Destructor
o CATRawColldouble
public CATRawColldouble( | | iInitAlloc | = 0 ) |
-
Constructs an empty list of doubles.
- Parameters:
-
- iInitAlloc
- The default capacity of the list.
o CATRawColldouble
public CATRawColldouble( | | iArray, |
| | iSize) |
-
Constructs a list and initializes it with a C++ double array.
- Parameters:
-
- iArray
- A C++ array of doubles used to initialize the list.
- iSize
- The size of the C++ array of doubles used to initialize the list.
o CATRawColldouble
public CATRawColldouble( | const | iCopy) |
-
Copy constructor.
- Parameters:
-
- iCopy
- The list to copy.
o ~CATRawColldouble
public virtual ~CATRawColldouble( | ) |
-
Destructor.
Methods
o Append
-
Appends a double to the list.
- Parameters:
-
- iAdd
- The double to append.
- Returns:
- 0 upon sucess, 1 if there is no more free memory.
o Append
public Append( | const | iConcat) |
-
Appends the content of a double list.
- Parameters:
-
- iConcat
- The floating-point number list to append.
- Returns:
- 0 upon sucess, 1 if there is no more free memory.
o Compare
public static Compare( | const | iRC1, |
| const | iRC2) |
-
Compares two lists of doubles.
- Parameters:
-
- iRC1
- The first list
- iRC2
- The second list
- Returns:
-
Legal values: 0 if the lists are equal,
-1 if the first list is smaller than the second list
(smaller means that the first list contains less elements than the second
list or that iRC1[i] < iRC2[i] for the first i where
iRC1[i] != iRC2[i]), or 1 otherwise.
o FillArray
public FillArray( | | ioArray, |
| | iMaxSize) |
-
Fills a C++ array of doubles with elements from the list.
- Parameters:
-
- ioArray
- The C++ array to fill.
- iMaxSize
- The size of the C++ array to fill.
o InsertAt
public InsertAt( | | iIndex, |
| | iAdd) |
-
Inserts a double within the list at the specified index.
- Parameters:
-
- iIndex
- The index at which the double is to be inserted.
Legal values: Equals 1 if the double is to be
inserted at the head of the list, and Size() + 1
if the double is to be inserted at the tail of the list.
- iAdd
- The double to insert.
- Returns:
- 0 upon sucess, 1 if there is no more free memory.
o Intersection
public static Intersection( | const | iRC1, |
| const | iRC2, |
| | ioResult) |
-
Computes the intersection of two lists.
- Parameters:
-
- iRC1
- The first list.
- iRC2
- The second list.
- ioResult
- A list to which elements in the intersection are appended.
o Locate
public Locate( | | iLocate, |
| | iIndex | = 1 ) |
-
Finds the first occurrence of a double from a given index.
- Parameters:
-
- iLocate
- The double to locate.
- iIndex
- The index at which the search is to begin.
- Returns:
- The index of the located double, or 0 if the list does not contain
the specified double.
o NbOccur
-
Counts the occurrences of a double in the list.
- Parameters:
-
- iTest
- The double for which the occurrences are to be counted.
- Returns:
- The number of occurrences of the double in the list.
o QuickSort
-
Sorts the list using the quicksort algorithm.
o Remove
public Remove( | const | iSubstract) |
-
Removes all the values specifed in iSubstract from the list.
- Parameters:
-
- iSubstract
- The list of doubles to remove.
- Returns:
- The count of doubles removed from the list.
o RemoveAll
public RemoveAll( | | iMH | = CATCollec::ReleaseAllocation ) |
-
Removes all the elements from the list.
- Parameters:
-
- iMH
-
Legal values: Specifies whether the list capacity
should be shrunk to 0 (CATCollec::ReleaseAllocation)
or not (CATCollec::KeepAllocation).
o RemoveDuplicates
public RemoveDuplicates( | | ioExtract | = NULL ) |
-
Removes all the duplicate occurrences of a double from the list and
appends them to another list.
- Parameters:
-
- ioExtract
- A list to which duplicate doubles are appended.
Legal values: Any valid pointer to a CATListOfDouble
instance. The default value is NULL: this causes duplicate
occurrences to simply be removed and not stored anywhere else.
- Returns:
- The count of duplicate doubles removed from the list.
o RemoveNulls
-
Removes all the doubles equal to 0.0.
- Returns:
- The count of null doubles removed from the list.
o RemovePosition
public RemovePosition( | | iIndex) |
-
Removes the double located at a given index.
- Parameters:
-
- iIndex
- The list index of the double to remove.
o RemovePosition
public RemovePosition( | | iIndex, |
| | iNbElem) |
-
Removes several doubles from the starting given index.
- Parameters:
-
- iIndex
- The stating list index of the doubles to remove.
- iNbElem
- The number of doubles to remove.
- Returns:
- The count of doubles removed from the list.
o RemoveValue
public RemoveValue( | | iRemove) |
-
Removes the first occurrence of a double from the list.
- Parameters:
-
- iRemove
- The double to remove.
- Returns:
- The index of the removed double, or 0 if the list does not contain
the specified double.
o Size
-
Returns the size of the list.
- Returns:
- the size of the list.
o Size
-
Forces the size of the list to an arbitrary size.
Role: If iSize is larger than the current
size, the newly allocated slots contain random double values.
- Parameters:
-
- iSize
- The desired size.
- Returns:
- 0 upon sucess, 1 if there is no more free memory.
o Size
public Size( | | iSize, |
| | iFiller) |
-
Forces the size of the list to an arbitrary size.
Role: If iSize is larger than the current
size, the newly allocated slots contain iFiller.
- Parameters:
-
- iSize
- The desired size.
- iFiller
- A double used to fill newly allocated slots.
- Returns:
- 0 upon sucess, 1 if there is no more free memory.
o Swap
public Swap( | | iIndex1, |
| | iIndex2) |
-
Swaps two list elements.
- Parameters:
-
- iIndex1
- index of the first element to swap.
- iIndex2
- index of the second element to swap.
o operator !=
public operator !=( | const | iRC) |
-
Inequality operator.
- Parameters:
-
- iRC
- The list to test for inequality
- Returns:
- 1 if the two lists are not equal, 0 otherwise.
o operator =
public operator =( | const | iCopy) |
-
Assignment operator.
Role: Overwrites the content of the list with
another list.
- Parameters:
-
- iCopy
- The assigned list.
o operator ==
public operator ==( | const | iRC) |
-
Equality operator.
Role: Two lists are equal if they contain the same
elements in the same order.
- Parameters:
-
- iRC
- The list to test for equality
- Returns:
-
Legal values: 1 if the two lists are equal,
0 otherwise
o operator[]
public operator[]( | | iIndex) |
-
Subscripting operator.
- Parameters:
-
- iIndex
- The index of the element.
- Returns:
- The double at index iIndex.
o operator[]
public operator[]( | | iIndex) |
-
Subscripting operator.
- Parameters:
-
- iIndex
- The index of the element.
- Returns:
- The double at index iIndex.
This object is included in the file: CATListOfDouble.h
If needed, your Imakefile.mk should include the module: JS0GROUP
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.