Classes | Typedefs | Enumerations | Functions
SQCommon.h File Reference
#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQFloatVector.h"
#include "SQIntVector.h"

Go to the source code of this file.

Classes

struct  SQ_ModelOptions
 
struct  tagSQ_ModelInfo
 

Typedefs

typedef enum SQ_ProductEnum SQ_Product
 
typedef enum SQ_BoolEnum SQ_Bool
 
typedef enum SQ_TriStateUnscaledState SQ_UnscaledState
 
typedef enum SQ_TriStateBacktransformedState SQ_BacktransformedState
 
typedef enum SQ_TriStateReconstructState SQ_ReconstructState
 
typedef enum SQ_TriStateStandardizedState SQ_StandardizedState
 
typedef enum SQ_TriStateResolveHierachicalState SQ_ResolveHierachicalState
 
typedef enum SQ_TriStateNormalizedState SQ_NormalizedState
 
typedef enum SQ_TriStateModelingPowerWeightedState SQ_ModelingPowerWeightedState
 
typedef enum SQ_CoefficientsRotatedTypeEnum SQ_CoefficientsRotatedType
 
typedef enum SQ_ModelTypeEnum SQ_ModelType
 
typedef enum SQ_WeightTypeEnum SQ_WeightType
 
typedef enum SQ_VariableTypeType SQ_VariableType
 
typedef enum SQ_BlockTypeEnum SQ_VariableBlock
 
typedef struct tagSQ_ModelInfo SQ_ModelInfo
 
typedef void(* SQ_LogFunction) (const char *szMessage, int iStatus)
 
typedef void(* SQ_PredictionLogFunction) (int iNumberOfPredictions, int iNumberOfProjectsOpened)
 

Enumerations

enum  SQ_ProductEnum { SQ_SQP =0, SQ_SQPPlus, SQ_SQM, SQ_SQAll }
 
enum  SQ_BoolEnum { SQ_False = 0, SQ_True }
 
enum  SQ_TriStateUnscaledState { SQ_Unscaled_False = 0, SQ_Unscaled_True, SQ_Unscaled_Default }
 
enum  SQ_TriStateBacktransformedState { SQ_Backtransformed_False = 0, SQ_Backtransformed_True, SQ_Backtransformed_Default }
 
enum  SQ_TriStateReconstructState { SQ_Reconstruct_False = 0, SQ_Reconstruct_True, SQ_Reconstruct_Default }
 
enum  SQ_TriStateStandardizedState { SQ_Standardized_False = 0, SQ_Standardized_True, SQ_Standardized_Default }
 
enum  SQ_TriStateResolveHierachicalState { SQ_ResolveHierachical_False = 0, SQ_ResolveHierachical_True, SQ_ResolveHierachical_Default }
 
enum  SQ_TriStateNormalizedState { SQ_Normalized_False = 0, SQ_Normalized_True, SQ_Normalized_Default }
 
enum  SQ_TriStateModelingPowerWeightedState { SQ_ModelingPowerWeighted_False = 0, SQ_ModelingPowerWeighted_True, SQ_ModelingPowerWeighted_Default }
 
enum  SQ_CoefficientsRotatedTypeEnum { SQ_XYUnscaledUncenterd = 0, SQ_XUnscaledCenterdYUnscaledUncenterd, SQ_XScaledCenterdYScaledUncenterd, SQ_MLR }
 
enum  SQ_ModelTypeEnum {
  SQ_UnDefined =0, SQ_PCA_X, SQ_PCA_Y, SQ_PCA_All,
  SQ_PCA_Class, SQ_PLS_Class, SQ_PLS, SQ_PLS_DA,
  SQ_OPLS, SQ_OPLS_DA, SQ_OPLS_Class, SQ_O2PLS,
  SQ_O2PLS_DA, SQ_O2PLS_Class, SQ_MOCA
}
 
enum  SQ_WeightTypeEnum {
  SQ_Weight_Normalized =0, SQ_Weight_Raw, SQ_Weight_P, SQ_Weight_WStar,
  SQ_Weight_RX, SQ_Weight_RY, SQ_Weight_CoeffCS, SQ_Weight_CoeffCSRaw,
  SQ_Weight_VIP, SQ_Weight_WStarRange, SQ_Weight_PRange, SQ_Weight_PO
}
 
enum  SQ_VariableTypeType { SQ_XVariable = 0, SQ_YVariable, SQ_UnDefVariable }
 
enum  SQ_BlockTypeEnum { SQ_BlockX, SQ_BlockY }
 

Functions

SQ_ErrorCode SQ_GetLoggingStatus (SQ_Bool *pbStatus)
 
SQ_ErrorCode SQ_SetLoggingStatus (SQ_Bool bLogOn)
 
SQ_ErrorCode SQ_SetLogFile (const char *szPathName)
 
SQ_ErrorCode SQ_GetLogFile (char *szPathName, int iBufferLength)
 
SQ_ErrorCode SQ_SetLogFunction (SQ_LogFunction pFunction)
 
SQ_ErrorCode SQ_SetPredictionLogFile (const char *szPathName)
 
SQ_ErrorCode SQ_GetPredictionLogFile (char *szPathName, int iBufferLength)
 
SQ_ErrorCode SQ_SetPredictionLogFunction (SQ_PredictionLogFunction pFunction)
 
SQ_ErrorCode SQ_GetMissingValue (float *pfVal)
 
SQ_ErrorCode SQ_GetVersionNumber (int *iMajorVersion, int *iMinorVersion, int *iBuildNumber, int *iRevisionNumber)
 
SQ_ErrorCode SQ_SetOEMPassword (const char *szOEMPassword)
 
SQ_ErrorCode SQ_SetLicensePath (const char *szLicensePath)
 
SQ_ErrorCode SQ_SetPluginPath (const char *szPluginPath)
 
SQ_ErrorCode SQ_IsLicenseFileValid (SQ_Bool *bValid)
 
SQ_ErrorCode SQ_GetLicenseFileExpireDate (char *szExpireDate, int iLength)
 
SQ_ErrorCode SQ_GetLicenseFileProduct (SQ_Product *pSQProduct)
 
SQ_ErrorCode SQ_IsProjectValid (const char *szProjectName, const char *szPassword, SQ_Bool *bValid)
 
SQ_ErrorCode SQ_UseMultiThreading (SQ_Bool bMultiThread, int iNumProcessors)
 

Detailed Description

This file includes all enum objects used in different functions and common functions about logging, license file etc.

Typedef Documentation

◆ SQ_BacktransformedState

An enum defining the a tristate for Backtransformed.

◆ SQ_Bool

typedef enum SQ_BoolEnum SQ_Bool

An enum defining true or false.

◆ SQ_CoefficientsRotatedType

Different types of coefficients that is used in the GetModelCoefficientsRotated function.

◆ SQ_LogFunction

typedef void( * SQ_LogFunction) (const char *szMessage, int iStatus)
See also
SQ_SetLogFunction
Parameters
[out]szMessageThe log message, UTF-8 encoded.
[out]iStatus1 if the message is an error message, 0 if the message is an informative message.

◆ SQ_ModelInfo

typedef struct tagSQ_ModelInfo SQ_ModelInfo

A struct with information about a model

◆ SQ_ModelingPowerWeightedState

An enum defining the a tristate for Modeling power weighted.

◆ SQ_ModelType

An enum defining the different model types.

◆ SQ_NormalizedState

An enum defining the a tristate for Normalized.

◆ SQ_PredictionLogFunction

typedef void( * SQ_PredictionLogFunction) (int iNumberOfPredictions, int iNumberOfProjectsOpened)
See also
SQ_SetPredictionLogFunction
Parameters
[out]iNumberOfPredictionsNumber of predictions made since last time the callback function was called.
[out]iStatusNumber of projects that has been opened since last time the callback function was called.

◆ SQ_Product

typedef enum SQ_ProductEnum SQ_Product

An enum defining the different product types.

◆ SQ_ReconstructState

An enum defining the a tristate for Reconstruct.

◆ SQ_ResolveHierachicalState

An enum defining the a tristate for ResolveHierachical.

◆ SQ_StandardizedState

An enum defining the a tristate for Standardized.

◆ SQ_UnscaledState

An enum defining the a tristate for Unscaled.

◆ SQ_VariableBlock

Indicates which variable block a variable belongs to.

◆ SQ_VariableType

Enum values describing what kind of type a variable is of

◆ SQ_WeightType

An enum defining the different weights that are expected as input to the Contribution functions.

Enumeration Type Documentation

◆ SQ_BlockTypeEnum

Indicates which variable block a variable belongs to.

Enumerator
SQ_BlockX 

A variable belonging to the X block.

SQ_BlockY 

A variable belonging to the Y block.

◆ SQ_BoolEnum

An enum defining true or false.

◆ SQ_CoefficientsRotatedTypeEnum

Different types of coefficients that is used in the GetModelCoefficientsRotated function.

Enumerator
SQ_XYUnscaledUncenterd 

Both X and Y are unscaled and uncentered

SQ_XUnscaledCenterdYUnscaledUncenterd 

X is unscaled and centered, Y is unscaled and uncentered

SQ_XScaledCenterdYScaledUncenterd 

X is scaled and centered, Y is scaled and uncentered

SQ_MLR 

X is scaled and centered, Y is unscaled and uncentered, the second centering and scaling of the cross terms and squares has been removed.

◆ SQ_ModelTypeEnum

An enum defining the different model types.

Enumerator
SQ_UnDefined 

The model type can not be determined

SQ_PCA_X 

The model is a PCA_X model

SQ_PCA_Y 

The model is a PCA_Y model

SQ_PCA_All 

The model is a PCA_All model

SQ_PCA_Class 

The model is a PCA_Class model

SQ_PLS_Class 

The model is a PLS_Class model

SQ_PLS 

The model is a PLS model

SQ_PLS_DA 

The model is a PLS_DA model

SQ_OPLS 

The model is an OPLS model

SQ_OPLS_DA 

The model is an OPLS_DA model

SQ_OPLS_Class 

The model is an OPLS_Class model

SQ_O2PLS 

The model is an O2PLS model

SQ_O2PLS_DA 

The model is an O2PLS_DA model

SQ_O2PLS_Class 

The model is an O2PLS_Class model

SQ_MOCA 

The model is an Multiblock model

◆ SQ_ProductEnum

An enum defining the different product types.

Enumerator
SQ_SQP 

The product is SIMCA-QP.

SQ_SQPPlus 

The product is SIMCA-QP+.

SQ_SQM 

The product is SIMCA-QM.

SQ_SQAll 

The product is SIMCA-Q All (QP, QP+ and QM).

◆ SQ_TriStateBacktransformedState

An enum defining the a tristate for Backtransformed.

◆ SQ_TriStateModelingPowerWeightedState

An enum defining the a tristate for Modeling power weighted.

◆ SQ_TriStateNormalizedState

An enum defining the a tristate for Normalized.

◆ SQ_TriStateReconstructState

An enum defining the a tristate for Reconstruct.

◆ SQ_TriStateResolveHierachicalState

An enum defining the a tristate for ResolveHierachical.

◆ SQ_TriStateStandardizedState

An enum defining the a tristate for Standardized.

◆ SQ_TriStateUnscaledState

An enum defining the a tristate for Unscaled.

◆ SQ_VariableTypeType

Enum values describing what kind of type a variable is of

Enumerator
SQ_XVariable 

Variable is X.

SQ_YVariable 

Variable is Y.

SQ_UnDefVariable 

Variable is Undefined, that means it's included in the model because it's needed for predictions, but neither X or Y.

◆ SQ_WeightTypeEnum

An enum defining the different weights that are expected as input to the Contribution functions.

Enumerator
SQ_Weight_Normalized 

No weights are used, but displayed in the units of the workset.

SQ_Weight_Raw 

No weights are used. Displays the subtraction of the values in one observation minus the other in original units.

SQ_Weight_P 

Weight P, PCA loading

SQ_Weight_WStar 

Weight W*, PLS weight

SQ_Weight_RX 

Weight RX, modeled variance

SQ_Weight_RY 

Weight RY, modeled variance

SQ_Weight_CoeffCS 

Weight CoeffCS, regression coefficients centered and scaled.

SQ_Weight_CoeffCSRaw 

Weight CoeffCSRaw. Contributions are normally weighted with the absolute value of the weights. But Y Predicted contributions uses raw CoeffCS weights.

SQ_Weight_VIP 

Weight VIP

SQ_Weight_WStarRange 

Weight W*Range

SQ_Weight_PRange 

Weight PRange, for OPLS models the component parameter is ignored, all components are used.

SQ_Weight_PO 

Weight Po orthogonal loadings, component parameter is the orthogonal component

Function Documentation

◆ SQ_GetLicenseFileExpireDate()

SQ_ErrorCode SQ_GetLicenseFileExpireDate ( char *  szExpireDate,
int  iLength 
)

Checks if a license file is present and valid and in that case for how long the license is valid.

Parameters
[in,out]szExpireDateA buffer to where the expire date should be stored. The string will be empty if no expire date is set or if the license file is not valid. The user is responsible for allocation/deallocation.
[in]iLengthThe size of the buffer.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetLicenseFileProduct()

SQ_ErrorCode SQ_GetLicenseFileProduct ( SQ_Product pSQProduct)

Get the product of the license file.

Parameters
[out]pSQProductThe product of the license file.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetLogFile()

SQ_ErrorCode SQ_GetLogFile ( char *  szPathName,
int  iBufferLength 
)

Returns the path of the log file, "" if there does not exist a log file (the log has been turned of or the log function is used).

Parameters
[in,out]szPathNameThe path to and name of the logfile, 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

◆ SQ_GetLoggingStatus()

SQ_ErrorCode SQ_GetLoggingStatus ( SQ_Bool pbStatus)

Returns a status indicating if SIMCA-Q is logging information and errors or not.

Parameters
[out]pbStatusSQ_True if the log is on, SQ_False otherwise
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetMissingValue()

SQ_ErrorCode SQ_GetMissingValue ( float *  pfVal)

Retrieves the number that represents missing value.

Parameters
[out]pfValThe number that represents missing value in SIMCA-Q.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_GetPredictionLogFile()

SQ_ErrorCode SQ_GetPredictionLogFile ( char *  szPathName,
int  iBufferLength 
)

Returns the path of the prediction log file, "" if there does not exist a log file (the license doesn't enable logging or the log function is used).

Parameters
[in,out]szPathNameThe path to and name of the logfile, 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

◆ SQ_GetVersionNumber()

SQ_ErrorCode SQ_GetVersionNumber ( int *  iMajorVersion,
int *  iMinorVersion,
int *  iBuildNumber,
int *  iRevisionNumber 
)

Retrieves the version number of the SIMCA-Q.dll. Four numbers will be returned that can be combined in the following format 13.0.0.0.

Parameters
[out]iMajorVersionThe major version.
[out]iMinorVersionThe minor version.
[out]iBuildNumberThe build number.
[out]iRevisionNumberThe revision number.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_IsLicenseFileValid()

SQ_ErrorCode SQ_IsLicenseFileValid ( SQ_Bool bValid)

Checks if a license file is present and in that case valid.

Parameters
[out]bValidSQ_True if the file has been found and is valid, SQ_False if not, in that case see the log file for details.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_IsProjectValid()

SQ_ErrorCode SQ_IsProjectValid ( const char *  szProjectName,
const char *  szPassword,
SQ_Bool bValid 
)

Checks if a project is valid and can be opened by this version of SIMCA-Q. Don't use this function on a opened project.

Parameters
[in]szProjectNameThe full path to the project file, UTF-8 encoded.
[in]szPasswordThe password if the project is password protected, UTF-8 encoded, if not use NULL.
[out]bValidSQ_True if the file is a valid project, SQ_False if not, in that case see the log file for details.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetLicensePath()

SQ_ErrorCode SQ_SetLicensePath ( const char *  szLicensePath)

Set the directory of where the license file is located. If this function is not called SIMCA-Q will look for the license file in the working directory.

Parameters
[in]szLicensePathPath to where the license file is located, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetLogFile()

SQ_ErrorCode SQ_SetLogFile ( const char *  szPathName)

User defined log file. This function can only be called before any other initialization. Make sure that the directory exists before calling this function.

Parameters
[in]szPathNameThe path to and name of the logfile, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetLogFunction()

SQ_ErrorCode SQ_SetLogFunction ( SQ_LogFunction  pFunction)

User defined log function.

Parameters
[in]pFunctionThe function the user wants to use for logging.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetLoggingStatus()

SQ_ErrorCode SQ_SetLoggingStatus ( SQ_Bool  bLogOn)

Sets the status indicating if SIMCA-Q should log information and errors or not.

Parameters
[in]bLogOnSQ_True if the log should be turned on, SQ_False otherwise
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetOEMPassword()

SQ_ErrorCode SQ_SetOEMPassword ( const char *  szOEMPassword)

If the SIMCA-Q is part of an OEM solution, the password for the license file should be applied with this function. The password is case sensitive.

Parameters
[in]szOEMPasswordThe OEM password that is valid for the license file, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetPluginPath()

SQ_ErrorCode SQ_SetPluginPath ( const char *  szPluginPath)

Set the directory of where the plug-ins for spectral filters are located. If this function is not called SIMCA-Q will look for the plug-ins in the working directory.

Parameters
[in]szPluginPathPath to where the plug-ins are located, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetPredictionLogFile()

SQ_ErrorCode SQ_SetPredictionLogFile ( const char *  szPathName)

Prediction logging User defined prediction log file. This function can only be called before opening a project. Make sure that the directory exists before calling this function.

Parameters
[in]szPathNameThe path to and name of the prediction logging, UTF-8 encoded.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_SetPredictionLogFunction()

SQ_ErrorCode SQ_SetPredictionLogFunction ( SQ_PredictionLogFunction  pFunction)

User defined prediction log function.

Parameters
[in]pFunctionThe function the user wants to use for logging.
Returns
Returns SQ_E_OK if success or an error code

◆ SQ_UseMultiThreading()

SQ_ErrorCode SQ_UseMultiThreading ( SQ_Bool  bMultiThread,
int  iNumProcessors 
)

Turn multi-threading on or off. Multi-threading makes SIMCA-Q faster for larger projects if run on more than one processor. Multi-threading should be turned off for small projects were many predictions are performed and for hyper-threaded (old Pentium) processors.

Parameters
[in]bMultiThreadSQ_True to use multi-threading, SQ_False if no multi-threading should be used.
[in]iNumProcessorsThe number of processors decides the maximum number of simultaneous threads SIMCA-Q will execute. A higher value than the actual number of processors will make SIMCA-Q slower. -1 means default number of processors. This parameter is ignored if bMultiThread is set to SQ_False.
Returns
Returns SQ_E_OK if success or an error code

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