Classes | Typedefs | Functions
SQMImport.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQProject.h"
#include "SQStringMatrix.h"

Go to the source code of this file.

Classes

struct  tagSQ_ImportHandle
 

Typedefs

typedef struct tagSQ_ImportHandleSQ_Import
 

Functions

SQ_ErrorCode SQ_InitImport (const char *szProjectPath, const char *szTempDir, SQ_Import *pImport)
 
SQ_ErrorCode SQ_InitImportNoUsp (SQ_Import *pImport)
 
SQ_ErrorCode SQ_InitImportDataset (SQ_Project pProject, const char *szDatasetName, SQ_Import *pImport)
 
SQ_ErrorCode SQ_Reserve (SQ_Import pImport, int iNumObs, int iNumQuantitative, int iNumQualitative)
 
SQ_ErrorCode SQ_AddLocalCenteringData (SQ_Import pImport, int iCenterID, SQ_StringVector *pVariableNames, float fValue)
 
SQ_ErrorCode SQ_SetObservationNames (SQ_Import pImport, SQ_StringMatrix *pObservationIDs, int iPrimaryID)
 
SQ_ErrorCode SQ_SetMissingValueRepresentation (SQ_Import pImport, float fMissing)
 
SQ_ErrorCode SQ_SetMissingValueStringRepresentation (SQ_Import pImport, const char *szMisVal)
 
SQ_ErrorCode SQ_AddQuantitativeVariables (SQ_Import pImport, SQ_FloatMatrix *pData, SQ_StringMatrix *pVariableIDs, int iPrimaryID)
 
SQ_ErrorCode SQ_AddQualitativeVariables (SQ_Import pImport, SQ_StringMatrix *pData, SQ_StringMatrix *pVariableIDs, int iPrimaryID)
 
SQ_ErrorCode SQ_SetVariableIDSeriesNames (SQ_Import pImport, SQ_StringVector *szNames)
 
SQ_ErrorCode SQ_SetObservationIDSeriesNames (SQ_Import pImport, SQ_StringVector *szNames)
 
SQ_ErrorCode SQ_SetYColumns (SQ_Import pImport, SQ_IntVector *pYColumns)
 
SQ_ErrorCode SQ_SetDateTimeColumns (SQ_Import pImport, SQ_IntVector *pDateTimeColumns)
 
SQ_ErrorCode SQ_SetDataSetName (SQ_Import pImport, const char *szName)
 
SQ_ErrorCode SQ_FinishImport (SQ_Import *pImport, SQ_Project *pProject)
 
SQ_ErrorCode SQ_FinishImportDataset (SQ_Import *pImport, int *iDatasetNumber)
 
SQ_ErrorCode SQ_FinishImportMerge (SQ_Import *pImport, int iDatasetNumber)
 

Typedef Documentation

◆ SQ_Import

typedef struct tagSQ_ImportHandle * SQ_Import

The import handle used to identify an ongoing import. IMPORTANT: Always initialize it to NULL!

Function Documentation

◆ SQ_AddLocalCenteringData()

SQ_ErrorCode SQ_AddLocalCenteringData ( SQ_Import  pImport,
int  iCenterID,
SQ_StringVector pVariableNames,
float  fValue 
)

Add information on local centering. With local centering one models the variation of the variable, or part of variable with for instance classes, around the specified center. If the szCenterIDsetting or variable name don't match the one imported this call will be ignored.

Parameters
[in]pImportHandle for the import of the new project.
[in]iCenterIDThe observation ID index specifying the observations to center.
[in]pVariableNamesThe name of the variables to center
[in]fValueThe value to subtract from the selected observation/variable combination.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_AddQualitativeVariables()

SQ_ErrorCode SQ_AddQualitativeVariables ( SQ_Import  pImport,
SQ_StringMatrix pData,
SQ_StringMatrix pVariableIDs,
int  iPrimaryID 
)

Add qualitative variables to the new dataset. Note: If this import is a merge or a secondary dataset with existing variables, the values for each variable can not be a value that did not already exist. I.e., you can not import new settings for a qualitative variable.

Parameters
[in]pImportHandle for the import of the new project.
[in]pDataMatrix containing the qualitative variable values each row is an observation, and each column is a variable.
[in]pVariableIDsMatrix containing the qualitative variable names names, each column is an variable, put secondary observation IDs in rows
[in]iPrimaryIDThe index of the ID to use as primary variable ID. Every entry in the primary variable ID vector must be unique. If 0, primary ids will be auto generated.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_AddQuantitativeVariables()

SQ_ErrorCode SQ_AddQuantitativeVariables ( SQ_Import  pImport,
SQ_FloatMatrix pData,
SQ_StringMatrix pVariableIDs,
int  iPrimaryID 
)

Add quantitative variables to the new dataset.

Parameters
[in]pImportHandle for the import of the new project.
[in]pDataMatrix containing the quantitative variable values each row is an observation, and each column is a variable.
[in]pVariableIDsMatrix containing the quantitative variable names names, each column is an variable, put secondary variable IDs in rows.
[in]iPrimaryIDThe index of the ID to use as primary variable ID. Every entry in the primary variable ID vector must be unique. If 0, primary ids will be auto generated.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_FinishImport()

SQ_ErrorCode SQ_FinishImport ( SQ_Import pImport,
SQ_Project pProject 
)

Create a dataset of the variables and observations added. This function automatically releases the import handle created from SQ_InitImport().

Parameters
[in]pImportHandle for the import of the new project.
[out]pProjectThe handle to the new project.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_FinishImportDataset()

SQ_ErrorCode SQ_FinishImportDataset ( SQ_Import pImport,
int *  iDatasetNumber 
)

Create the new dataset of the variables and observations added. The import handle must come from SQ_InitImportDataset(), otherwise it will fail. This function automatically releases the import handle created from SQ_InitImportDataset().

Parameters
[in]pImportHandle for the import of the new dataset.
[out]iDatasetNumberThe number of the new dataset.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_FinishImportMerge()

SQ_ErrorCode SQ_FinishImportMerge ( SQ_Import pImport,
int  iDatasetNumber 
)

Merge the imported data into an existing dataset. No new variables may exist in the import that does not exist in the existing dataset. All created models for the specified dataset will be deleted. The import handle must come from SQ_InitImportDataset(), otherwise it will fail. This function automatically releases the import handle created from SQ_InitImportDataset().

Parameters
[in]pImportHandle for the import of the new dataset.
[in]iDatasetNumberThe dataset number to merge to.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_InitImport()

SQ_ErrorCode SQ_InitImport ( const char *  szProjectPath,
const char *  szTempDir,
SQ_Import pImport 
)

Prepare import of data to a new project. It is the users responsibility to close the import when finished (SQ_FinishImport).

Parameters
[in]szProjectPathThe path, including the project name and for the project, UTF-8 encoded.
[in]szTempDirThe directory where temporary files should be saved and where the project should recover from, UTF-8 encoded. Recovering is disabled if szTempDir = NULL.
[out]pImportThe handle to this import.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_InitImportDataset()

SQ_ErrorCode SQ_InitImportDataset ( SQ_Project  pProject,
const char *  szDatasetName,
SQ_Import pImport 
)

Prepare import of a new dataset to an existing project. It is the users responsibility to close the project when finished (SQ_CloseImport).

Parameters
[in]pProjectThe project to import the new dataset to.
[in]szDatasetNameThe name of the new dataset, UTF-8 encoded.
[out]pImportThe handle to this import.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_InitImportNoUsp()

SQ_ErrorCode SQ_InitImportNoUsp ( SQ_Import pImport)

Prepare import of data to a new project, the new project will not be saved on disk but kept in memory. To save the project to disk when it has been created call SQ_SaveAs. It is the users responsibility to close the import when finished (SQ_FinishImport).

Parameters
[out]pImportThe handle to this import.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_Reserve()

SQ_ErrorCode SQ_Reserve ( SQ_Import  pImport,
int  iNumObs,
int  iNumQuantitative,
int  iNumQualitative 
)

Reserve space for the import, this will make the import faster if you call AddQuantitativeVariables or AddQualitativeVariables more than once.

Parameters
[in]pImportHandle for the import of the new project.
[in]iNumObsThe total number of observations.
[in]iNumQuantitativeThe total number of quantitative variables.
[in]iNumQualitativeThe total number of qualitative variables.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetDataSetName()

SQ_ErrorCode SQ_SetDataSetName ( SQ_Import  pImport,
const char *  szName 
)

Set the name of the new dataset.

Parameters
[in]pImportHandle for the import of the new project.
[in]szNameThe name of the new dataset, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetDateTimeColumns()

SQ_ErrorCode SQ_SetDateTimeColumns ( SQ_Import  pImport,
SQ_IntVector pDateTimeColumns 
)

Specify the column in the matrix that is date/time

Parameters
[in]pImportHandle for the import of the new project.
[in]pDateTimeColumnsThe indices of the date/time columns.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetMissingValueRepresentation()

SQ_ErrorCode SQ_SetMissingValueRepresentation ( SQ_Import  pImport,
float  fMissing 
)

Set a value that the import will treat as a missing value for quantitative variables.

Parameters
[in]pImportHandle for the import of the new project.
[in]fMissingThe missing value representation.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetMissingValueStringRepresentation()

SQ_ErrorCode SQ_SetMissingValueStringRepresentation ( SQ_Import  pImport,
const char *  szMisVal 
)

Set a value that the import will treat as a missing value for qualitative variables.

Parameters
[in]pImportHandle for the import of the new project.
[in]szMisValThe missing value representation, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetObservationIDSeriesNames()

SQ_ErrorCode SQ_SetObservationIDSeriesNames ( SQ_Import  pImport,
SQ_StringVector szNames 
)

Name the secondary IDs, the primary ID is always called PrimaryID and can't be renamed call this function only after SetObservationNames.

Parameters
[in]pImportHandle for the import of the new project.
[in]szNamesThe names of the Observation id series.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetObservationNames()

SQ_ErrorCode SQ_SetObservationNames ( SQ_Import  pImport,
SQ_StringMatrix pObservationIDs,
int  iPrimaryID 
)

Set the observation names in the new dataset.

Parameters
[in]pImportHandle for the import of the new project.
[in]pObservationIDsMatrix containing the observation names, each row is an observation. Put secondary observation IDs in columns.
[in]iPrimaryIDThe index of the ID to use as primary observation ID. Every entry in the primary observation ID vector must be unique. if 0, primary ids will be auto generated.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetVariableIDSeriesNames()

SQ_ErrorCode SQ_SetVariableIDSeriesNames ( SQ_Import  pImport,
SQ_StringVector szNames 
)

Name the secondary IDs, the primary ID is always called PrimaryID and can't be renamed call this function only after Variables are added.

Parameters
[in]pImportHandle for the import of the new project.
[in]szNamesThe names of the variable id series.
Returns
Returns SQ_E_OK if success or an error code.

◆ SQ_SetYColumns()

SQ_ErrorCode SQ_SetYColumns ( SQ_Import  pImport,
SQ_IntVector pYColumns 
)

Set the index of the Y columns. Call this only after adding every time column

Parameters
[in]pImportHandle for the import of the new project.
[in]pYColumnsThe indexes of the Y columns in the data.
Returns
Returns SQ_E_OK if success or an error code.

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