mlpack
Namespaces | Functions
size_checks.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mlpack
 Linear algebra utility functions, generally performed on matrices or vectors.
 

Functions

template<typename DataType , typename LabelsType >
void mlpack::util::CheckSameSizes (const DataType &data, const LabelsType &label, const std::string &callerDescription, const std::string &addInfo="labels")
 Check for if the given data points & labels have same size. More...
 
template<typename DataType >
void mlpack::util::CheckSameSizes (const DataType &data, const size_t &size, const std::string &callerDescription, const std::string &addInfo="labels")
 An overload of CheckSameSizes() where the size to be checked is known previously. More...
 
template<typename DataType , typename DimType >
void mlpack::util::CheckSameDimensionality (const DataType &data, const DimType &dimension, const std::string &callerDescription, const std::string &addInfo="dataset")
 Check for if the given dataset dimension matches with the model's. More...
 
template<typename DataType >
void mlpack::util::CheckSameDimensionality (const DataType &data, const size_t &dimension, const std::string &callerDescription, const std::string &addInfo="dataset")
 An overload of CheckSameDimensionality() where the dimension to be checked is known second param is unsigned long int.
 

Detailed Description

Author
Kirill Mishchenko
Bisakh Mondal

Utility for checking same size & same dimensionality.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ CheckSameDimensionality()

template<typename DataType , typename DimType >
void mlpack::util::CheckSameDimensionality ( const DataType &  data,
const DimType &  dimension,
const std::string &  callerDescription,
const std::string &  addInfo = "dataset" 
)
inline

Check for if the given dataset dimension matches with the model's.

Parameters
datadataset.
dimensionDimension of the model.
callerDescriptionA description of the caller that can be used for error generation.
addInfoName to use for dataset for precise error generation. Default is "dataset"; for example, "weights" could also be used.

◆ CheckSameSizes() [1/2]

template<typename DataType , typename LabelsType >
void mlpack::util::CheckSameSizes ( const DataType &  data,
const LabelsType &  label,
const std::string &  callerDescription,
const std::string &  addInfo = "labels" 
)
inline

Check for if the given data points & labels have same size.

Parameters
datadata.
labelsLabels.
callerDescriptionA description of the caller that can be used for error generation.
addInfoName to use for labels for precise error generation. Default is "labels"; for example, "weights" could also be used.

◆ CheckSameSizes() [2/2]

template<typename DataType >
void mlpack::util::CheckSameSizes ( const DataType &  data,
const size_t &  size,
const std::string &  callerDescription,
const std::string &  addInfo = "labels" 
)
inline

An overload of CheckSameSizes() where the size to be checked is known previously.

The second parameter is of type unsigned int.