All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

System Class CATRawCollfloat

System.CATCollecRoot
  |
  +---CATRawCollfloat
 

Usage: you must use this class as is. You should never derive it.


public class CATRawCollfloat

Class to implement a mutable list of single-precision floating-point numbers.
Role: The purpose of this class is to let C++ classes easily pass and receive lists of floats. 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 CATListOfFloat


Constructor and Destructor Index


o CATRawCollfloat(CATRawCollfloat&)
Copy constructor.
o CATRawCollfloat(float*,int)
Constructs a list and initializes it with a C++ float array.
o CATRawCollfloat(int)
Constructs an empty list of floats.
o ~CATRawCollfloat()
Destructor.

Method Index


o Append(CATRawCollfloat&)
Appends the content of a float list.
o Append(float)
Appends a float to the list.
o Compare(CATRawCollfloat&,CATRawCollfloat&)
Compares two lists of floats.
o FillArray(float*,int)
Fills a C++ array of floats with elements from the list.
o InsertAt(int,float)
Inserts a float within the list at the specified index.
o Intersection(CATRawCollfloat&,CATRawCollfloat&,CATRawCollfloat&)
Computes the intersection of two lists.
o Locate(float,int)
Finds the first occurrence of a float from a given index.
o NbOccur(float)
Counts the occurrences of a float in the list.
o QuickSort()
Sorts the list using the quicksort algorithm.
o Remove(CATRawCollfloat&)
Removes all the values specifed in iSubstract from the list.
o RemoveAll(CATCollec::MemoryHandling)
Removes all the elements from the list.
o RemoveDuplicates(CATRawCollfloat*)
Removes all the duplicate occurrences of a float from the list and appends them to another list.
o RemoveNulls()
Removes all the floats equal to 0.
o RemovePosition(int)
Removes the float located at a given index.
o RemoveValue(float)
Removes the first occurrence of a float 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,float)
Forces the size of the list to an arbitrary size.
o Swap(int,int)
Swaps two list elements.
o operator !=(CATRawCollfloat&)
Inequality operator.
o operator =(CATRawCollfloat&)
Assignment operator.
o operator ==(CATRawCollfloat&)
Equality operator.
o operator[](int)
Subscripting operator.
o operator[](int)
Subscripting operator.

Constructor and Destructor


o CATRawCollfloat
public CATRawCollfloat( const CATRawCollfloat& iCopy)
Copy constructor.
Parameters:
iCopy
The list to copy.
o CATRawCollfloat
public CATRawCollfloat(float* iArray,
int iSize)
Constructs a list and initializes it with a C++ float array.
Parameters:
iArray
A C++ array of floats used to initialize the list.
iSize
The size of the C++ array of floats used to initialize the list.
o CATRawCollfloat
public CATRawCollfloat(int iInitAlloc= 0 )
Constructs an empty list of floats.
Parameters:
iInitAlloc
The default capacity of the list.
o ~CATRawCollfloat
public virtual ~CATRawCollfloat()
Destructor.

Methods


o Append
public int Append( const CATRawCollfloat& iConcat)
Appends the content of a float list.
Parameters:
iConcat
The float list to append.
Returns:
0 upon sucess, 1 if there is no more free memory.
o Append
public int Append(float iAdd)
Appends a float to the list.
Parameters:
iAdd
The float to append.
Returns:
0 upon sucess, 1 if there is no more free memory.
o Compare
public static int Compare( const CATRawCollfloat& iRC1,
const CATRawCollfloat& iRC2)
Compares two lists of floats.
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 void FillArray(float* ioArray,
int iMaxSize)const
Fills a C++ array of floats with elements from the list.
Parameters:
ioArray
The C++ array to fill.
iMaxSize
The size of the C++ array to fill.
o InsertAt
public int InsertAt(int iIndex,
float iAdd)
Inserts a float within the list at the specified index.
Parameters:
iIndex
The index at which the float is to be inserted.
Legal values: Equals 1 of the float is to be inserted at the head of the list, and Size() + 1 if the float is to be inserted at the tail of the list.
iAdd
The float to insert.
Returns:
0 upon sucess, 1 if there is no more free memory.
o Intersection
public static void Intersection( const CATRawCollfloat& iRC1,
const CATRawCollfloat& iRC2,
CATRawCollfloat& 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 int Locate(float iLocate,
int iIndex= 1 )const
Finds the first occurrence of a float from a given index.
Parameters:
iLocate
The float to locate.
iIndex
The index at which the search is to begin.
Returns:

Legal values: The index of the located float, or 0 if the list does not contain the specified float.
o NbOccur
public int NbOccur(float iTest)
Counts the occurrences of a float in the list.
Parameters:
iTest
The float for which the occurrences are to be counted.
Returns:
The count of occurrences of the float in the list.
o QuickSort
public void QuickSort()
Sorts the list using the quicksort algorithm.
o Remove
public int Remove( const CATRawCollfloat& iSubstract)
Removes all the values specifed in iSubstract from the list.
Parameters:
iSubstract
A list of floats to remove.
Returns:
The count of floats removed from the list.
o RemoveAll
public void RemoveAll(CATCollec::MemoryHandling 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 int RemoveDuplicates(CATRawCollfloat* ioExtract= NULL )
Removes all the duplicate occurrences of a float from the list and appends them to another list.
Parameters:
ioExtract
A list to which duplicate floats are appended.
Returns:
The count of duplicate floats removed from the list.
o RemoveNulls
public int RemoveNulls()
Removes all the floats equal to 0.0.
Returns:
The count of null floats removed from the list.
o RemovePosition
public void RemovePosition(int iIndex)
Removes the float located at a given index.
Parameters:
iIndex
The list index of the float to remove.
o RemoveValue
public int RemoveValue(float iRemove)
Removes the first occurrence of a float from the list.
Parameters:
iRemove
The float to remove.
Returns:

Legal values: The index of the removed float, or 0 if the list does not contain the specified float.
o Size
public int Size()
Returns the size of the list.
Returns:
the size of the list.
o Size
public int Size(int iSize)
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 float values.
Parameters:
iSize
The desired size.
Returns:
0 upon sucess, 1 if there is no more free memory.
o Size
public int Size(int iSize,
float 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 float used to fill newly allocated slots.
Returns:
0 upon sucess, 1 if there is no more free memory.
o Swap
public void Swap(int iIndex1,
int 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 int operator !=( const CATRawCollfloat& iRC)const
Inequality operator.
Parameters:
iRC
The list to test for inequality
Returns:

Legal values: 1 if the two lists are not equal, 0 otherwise.
o operator =
public CATRawCollfloat & operator =( const CATRawCollfloat& iCopy)
Assignment operator.
Role: Overwrites the content of the list with another list.
Parameters:
iCopy
The assigned list.
o operator ==
public int operator ==( const CATRawCollfloat& 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 float operator[](int iIndex)const
Subscripting operator.
Parameters:
iIndex
The index of the element.
Returns:
The float at index iIndex.
o operator[]
public float & operator[](int iIndex)
Subscripting operator.
Parameters:
iIndex
The index of the element.
Returns:
The float at index iIndex.

This object is included in the file: CATListOfFloat.h
If needed, your Imakefile.mk should include the module: JS0GROUP

Copyright © 2003, Dassault Systèmes. All rights reserved.