Classes | Typedefs | Enumerations | Functions
SQDataset.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQStringVector.h"
#include "SQIntVector.h"
#include "SQVectorData.h"
#include "SQVariable.h"

Go to the source code of this file.

Classes

struct  tagSQ_Dataset
 
struct  tagSQ_DatasetTypeVector
 

Typedefs

typedef struct tagSQ_DatasetSQ_Dataset
 
typedef enum SQ_DatasetTypeEnum SQ_DatasetType
 
typedef struct tagSQ_DatasetTypeVectorSQ_DatasetTypeVector
 

Enumerations

enum  SQ_DatasetTypeEnum {
  SQ_D_Standard =0, SQ_D_Spectral, SQ_D_Hierarchical, SQ_D_PLSDA,
  SQ_D_BatchLevel, SQ_D_ObservationLevel, SQ_D_BatchCondition, SQ_D_LagDistance
}
 

Functions

SQ_ErrorCode SQ_GetSizeOfDatasetTypeVector (const SQ_DatasetTypeVector pVector, int *piSize)
 
SQ_ErrorCode SQ_GetDataFromDatasetTypeVector (const SQ_DatasetTypeVector pVector, int iPos, SQ_DatasetType *pDatasetType)
 
SQ_ErrorCode SQ_GetDataSetName (SQ_Dataset pDataset, char *szDatasetName, int iBufferLength)
 
SQ_ErrorCode SQ_GetDataSetTypes (SQ_Dataset pDataset, SQ_DatasetTypeVector *pTypeVector)
 
SQ_ErrorCode SQ_GetNumberOfVariableIDs (SQ_Dataset pDataset, int *piNrVarIDs)
 
SQ_ErrorCode SQ_GetNumberOfObservationIDs (SQ_Dataset pDataset, int *piNrObsIDs)
 
SQ_ErrorCode SQ_GetDataSetVariableNames (SQ_Dataset pDataset, SQ_VariableVector *pVariableVector)
 
SQ_ErrorCode SQ_GetOriginalDataSetVariableNames (SQ_Dataset pDataset, SQ_VariableVector *pVariableVector)
 
SQ_ErrorCode SQ_GetDataSetVariableIDName (SQ_Dataset pDataset, int iNameIDIndex, char *pszVariableIDName, int iBufferLength)
 
SQ_ErrorCode SQ_GetDataSetObservationNames (SQ_Dataset pDataset, int iNameIDIndex, SQ_StringVector *pObservationNames)
 
SQ_ErrorCode SQ_GetDataSetObservationIDName (SQ_Dataset pDataset, int iNameIDIndex, char *pszObservationIDName, int iBufferLength)
 
SQ_ErrorCode SQ_GetDataSetObservations (SQ_Dataset pDataset, SQ_IntVector *pObservations, SQ_VectorData *pVectorData)
 
SQ_ErrorCode SQ_GetDataSetVariables (SQ_Dataset pDataset, SQ_IntVector *pVariables, SQ_VectorData *pVectorData)
 

Detailed Description

This file list the SQ_Dataset object used in Umetrics SIMCA-Q products.

Typedef Documentation

◆ SQ_Dataset

typedef struct tagSQ_Dataset * SQ_Dataset

The dataset handle used to identify an opened dataset. IMPORTANT: Always initialize it to NULL!

◆ SQ_DatasetType

An enum defining the different dataset types.

◆ SQ_DatasetTypeVector

The handle to identify a vector of dataset types.

Enumeration Type Documentation

◆ SQ_DatasetTypeEnum

An enum defining the different dataset types.

Enumerator
SQ_D_Standard 

The dataset is a standard dataset.

SQ_D_Spectral 

The dataset is a spectral dataset.

SQ_D_Hierarchical 

The dataset is a hierarchical dataset.

SQ_D_PLSDA 

The dataset is a PLS-DA dataset.

SQ_D_BatchLevel 

The dataset is a batch level dataset.

SQ_D_ObservationLevel 

The dataset is an observation level batch dataset.

SQ_D_BatchCondition 

The dataset is a batch condition dataset.

SQ_D_LagDistance 

dataset for dynamic lags in a model.

Function Documentation

◆ SQ_GetDataFromDatasetTypeVector()

SQ_ErrorCode SQ_GetDataFromDatasetTypeVector ( const SQ_DatasetTypeVector  pVector,
int  iPos,
SQ_DatasetType pDatasetType 
)

Gets the type of dataset.

Parameters
[in]pVectorThe vector to get the data from.
[in]iPosThe position to get the data from.
[in]pDatasetTypeThe DatasetType.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetDataSetName()

SQ_ErrorCode SQ_GetDataSetName ( SQ_Dataset  pDataset,
char *  szDatasetName,
int  iBufferLength 
)

Retrieves the name of a dataset.

Parameters
[in]pDatasetThe dataset to use, UTF-8 encoded.
[in,out]szDatasetNameThe name of the dataset. The user is responsible to allocate and deallocate the buffer.
[in]iBufferLengthThe length of the buffer.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetDataSetObservationIDName()

SQ_ErrorCode SQ_GetDataSetObservationIDName ( SQ_Dataset  pDataset,
int  iNameIDIndex,
char *  pszObservationIDName,
int  iBufferLength 
)

Retrieves the names of the observation IDs in the given data set.

Parameters
[in]pDatasetThe dataset to use
[in]iNameIDIndexThe index of the Observation ID. 1 for the primary ID in the data set, 2 for the first level of secondary ID, 3 for the second level of secondary ID and so on.
[in,out]pszObservationIDNameThe name of the observation ID, UTF-8 encoded. The user is responsible to allocate and deallocate the buffer.
[in]iBufferLengthThe length of the buffer.
Returns
Returns SQ_E_OK if success or an error code
See also
SQ_GetNumberOfObservationIDs

◆ SQ_GetDataSetObservationNames()

SQ_ErrorCode SQ_GetDataSetObservationNames ( SQ_Dataset  pDataset,
int  iNameIDIndex,
SQ_StringVector pObservationNames 
)

Retrieves the names of the observations in the given data set.

Parameters
[in]pDatasetThe dataset to use
[in]iNameIDIndexThe index of the Observation ID. 1 for the primary ID in the data set, 2 for the first level of secondary ID, 3 for the second level of secondary ID and so on.
[out]pObservationNamesThe names of the observations. The vector must be cleared with SQ_ClearStringVector.
Returns
Returns SQ_E_OK if success or an error code
See also
SQ_GetNumberOfObservationIDs

◆ SQ_GetDataSetObservations()

SQ_ErrorCode SQ_GetDataSetObservations ( SQ_Dataset  pDataset,
SQ_IntVector pObservations,
SQ_VectorData pVectorData 
)

Retrieves the data for the observations in the given data set (ObsDS). If a variable is qualitative the index of the qualitative settings will be returned in the matrix. If the project option is set to reconstruct wavelet compression the data returned will reflect that.

Parameters
[in]pDatasetThe dataset to use
[in]pObservationsA list of observation Indices to use. 1 for observation 1 in the data set, 2 for observation 2 and so on. NULL if all observations in the data set should be used.
[out]pVectorDataA pointer to the ObsDS vector data. Number of rows in vector data = number of observations chosen (length of pObservations). Number of columns in vector data = number of variables in the dataset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetDataSetTypes()

SQ_ErrorCode SQ_GetDataSetTypes ( SQ_Dataset  pDataset,
SQ_DatasetTypeVector pTypeVector 
)

Retrieves the types of a dataset.

Parameters
[in]pDatasetThe dataset to use
[out]pTypeVectorThe types of dataset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetDataSetVariableIDName()

SQ_ErrorCode SQ_GetDataSetVariableIDName ( SQ_Dataset  pDataset,
int  iNameIDIndex,
char *  pszVariableIDName,
int  iBufferLength 
)

Retrieves the names of the variable IDs in the given data set.

Parameters
[in]pDatasetThe dataset to use
[in]iNameIDIndexThe index of the Variable ID. 1 for the primary ID in the data set, 2 for the first level of secondary ID, 3 for the second level of secondary ID and so on.
[in,out]pszVariableIDNameThe name of the variable ID (i.e. "Primary ID", "Secondary ID" etc.), UTF-8 encoded. The user is responsible to allocate and deallocate the buffer.
[in]iBufferLengthThe length of the buffer.
Returns
Returns SQ_E_OK if success or an error code
See also
SQ_GetNumberOfVariableIDs

◆ SQ_GetDataSetVariableNames()

SQ_ErrorCode SQ_GetDataSetVariableNames ( SQ_Dataset  pDataset,
SQ_VariableVector pVariableVector 
)

Retrieves the names of the variables in the given data set.

Parameters
[in]pDatasetThe dataset to use
[out]pVariableVectorThe variables included in the dataset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetDataSetVariables()

SQ_ErrorCode SQ_GetDataSetVariables ( SQ_Dataset  pDataset,
SQ_IntVector pVariables,
SQ_VectorData pVectorData 
)

Retrieves the data for the variables in the given data set (VarDS). If a variable is qualitative the index of the qualitative settings will be returned in the matrix.

Parameters
[in]pDatasetThe dataset to use
[in]pVariablesA list of variable indices to use. 1 for variable 1 in the data set, 2 for variable 2 and so on. NULL if all variables in the data set should be used.
[out]pVectorDataA pointer to the VarDS vector data. Number of rows in vector data = number of variables chosen (length of pObservations). Number of columns in vector data = number of observations in the dataset.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetNumberOfObservationIDs()

SQ_ErrorCode SQ_GetNumberOfObservationIDs ( SQ_Dataset  pDataset,
int *  piNrObsIDs 
)

Retrieves the number of different observations IDs in the dataset. If there exist both a primary ID and one level of secondary observation IDs, this equals to 2 observation IDs.

Parameters
[in]pDatasetThe dataset to use
[out]piNrObsIDsThe number of observation IDs.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetNumberOfVariableIDs()

SQ_ErrorCode SQ_GetNumberOfVariableIDs ( SQ_Dataset  pDataset,
int *  piNrVarIDs 
)

Retrieves the number of different variable IDs in the dataset. If there exist both a primary ID and one level of secondary variable IDs, this equals to 2 variable IDs.

Parameters
[in]pDatasetThe dataset to use
[out]piNrVarIDsThe number of variable IDs.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetOriginalDataSetVariableNames()

SQ_ErrorCode SQ_GetOriginalDataSetVariableNames ( SQ_Dataset  pDataset,
SQ_VariableVector pVariableVector 
)

Retrieves the original names of the variables in the given data set, before any processing. This function is only available for spectral datasets.

Parameters
[in]pDatasetThe dataset to use
[out]pVariableVectorThe original variables included in the dataset.
Returns
Returns SQ_E_OK if success or an error code
See also
GetNumberOfVariableIDs

◆ SQ_GetSizeOfDatasetTypeVector()

SQ_ErrorCode SQ_GetSizeOfDatasetTypeVector ( const SQ_DatasetTypeVector  pVector,
int *  piSize 
)

Returns the size of the dataset types vector.

Parameters
[in]pVectorThe vector to get the size of.
[out]piSizeThe size of the vector or a negative number if an error occurred.
Returns
Returns SQ_E_OK if success or an error code

Copyright (C) Sartorius Stedim Data Analytics AB - Generated by Doxygen