cta_reltable.h File Reference
Relation table component that defines a relation between two elements (ordered) sets of elements.
More...
#include "cta_system.h"
#include "cta_handles.h"
#include "cta_datatypes.h"
#include "cta_vector.h"
Go to the source code of this file.
Typedefs |
typedef CTA_Handle | CTA_RelTable |
Functions |
CTAEXPORT int | CTA_RelTable_Create (CTA_RelTable *hreltable) |
| Create a relation table.
|
CTAEXPORT int | CTA_RelTable_Free (CTA_RelTable *hreltable) |
| Free a relation table object.
|
CTAEXPORT int | CTA_RelTable_Apply (CTA_RelTable hreltable, CTA_Handle hfrom, CTA_Handle hto) |
| Copy elements according to relation table.
|
CTAEXPORT int | CTA_RelTable_ApplyInv (CTA_RelTable hreltable, CTA_Handle hfrom, CTA_Handle hto) |
| Copy elements according to inverse of relation table.
|
CTAEXPORT int | CTA_RelTable_SetSelect (CTA_RelTable hreltable, CTA_Vector vselect) |
| Set a relation table A Set a relation table that defines a selection of elements.
|
CTAEXPORT int | CTA_RelTable_Count (CTA_RelTable hreltable, int *nelt) |
| Get the number of elements that are copied when the table is applied.
|
CTAEXPORT int | CTA_RelTable_SetTableCombine (CTA_RelTable hreltable, CTA_RelTable hrel1, int inverse1, CTA_RelTable hrel2, int inverse2) |
| Set a relation table that is combination of two relation tables.
|
int | CTAI_RelTable_Apply (CTA_RelTable hreltable, CTA_Handle hfrom, CTA_Handle hto, int inverse) |
| Apply relation table to two components.
|
Detailed Description
Relation table component that defines a relation between two elements (ordered) sets of elements.
Relation tables are used to define a relation between elements in sets. Examples are the elements of a vector, matrix, tree vector or in a stochastic observer.
The Relation table can be used for copying elements from one set to the other optionally using interpolation (not yet supported).
Definition in file cta_reltable.h.
Typedef Documentation
Function Documentation
Copy elements according to relation table.
- Note:
- we currently only support copying of elements between two vector instances. Other types of COSTA object will be supported when needed in later versions
- Parameters:
-
| hreltable | I handle of relation table |
| hfrom | I Origin object to copy data from |
| hto | I Target object to copy data to |
- Returns:
- error status: CTA_OK if successful
Copy elements according to inverse of relation table.
- Note:
- we currently only support copying of elements between two vector instances. Other types of COSTA object will be supported when needed in later versions
- Parameters:
-
| hreltable | I handle of relation table |
| hfrom | I Origin object to copy data from |
| hto | I Target object to copy data to |
- Returns:
- error status: CTA_OK if successful
CTAEXPORT int CTA_RelTable_Count |
( |
CTA_RelTable |
hreltable, |
|
|
int * |
nelt | |
|
) |
| | |
Get the number of elements that are copied when the table is applied.
- Parameters:
-
| hreltable | I relation table |
| nelt | O number of elements that are copied |
- Returns:
- error status: CTA_OK if successful
CTAEXPORT int CTA_RelTable_Create |
( |
CTA_RelTable * |
hreltable |
) |
|
Create a relation table.
- Parameters:
-
| hreltable | O created relation table |
- Returns:
- error status: CTA_OK if successful
CTAEXPORT int CTA_RelTable_Free |
( |
CTA_RelTable * |
hreltable |
) |
|
Free a relation table object.
- Parameters:
-
| hreltable | IO relation table to be freed, value is set to CTA_NULL on return. |
- Returns:
- error status: CTA_OK if successful
Set a relation table A Set a relation table that defines a selection of elements.
- Parameters:
-
| hreltable | O relation table that is set |
| vselect | I (integer) vector with indices of elements from the target set that are selected. |
- Returns:
- error status: CTA_OK if successful
Set a relation table that is combination of two relation tables.
Set a relation table that is the combination of two exisiting relation tables. It is possible to use the inverse of the relation tables when needed A usefull application of this method is to create a relation table that defines a relation between a subset of elements from set1 and a subset of the elements of set2. In order to set a relation table of this kind first create two relation tables: hrel1 elements from set 1 that have a relation with the elements from set 2, hrel2 elements from set 2 that have a relation with the elements from set 1
The combined relation table of hrel1 and inverse(hrel2) is a relation table that spcifies the relation of a subset of elements from set1 and a subset of elements from set2.
- Parameters:
-
| hreltable | O relation table that is set |
| hrel1 | I first relation table |
| inverse1 | I use inverse of hrel1 (CTA_TRUE/CTA_FALSE) |
| hrel2 | I first relation table |
| inverse2 | I use inverse of hrel2 (CTA_TRUE/CTA_FALSE) |
- Returns:
- error status: CTA_OK if successful
Apply relation table to two components.
- Parameters:
-
| reltable | (I) Data of relation table |
| hrom | (I) Source set of elements |
| hto | (IO) Target set (some will be overwitten) |
| iverse | (I) CTA_TRUE/CTA_FALSE apply inverse table |
- Returns:
- error status: CTA_OK if successful
- Note:
- Internal routine not a user routine