Faiss

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Public Attributes | List of all members
faiss::RemapDimensionsTransform Struct Reference

`#include <VectorTransform.h>`

Inheritance diagram for faiss::RemapDimensionsTransform:

## Public Member Functions
| RemapDimensionsTransform (int d_in, int d_out, const int *map)
| RemapDimensionsTransform (int d_in, int d_out, bool uniform=true)
void | apply_noalloc (idx_t n, const float *x, float *xt) const override
| same as apply, but result is pre-allocated
void | reverse_transform (idx_t n, const float *xt, float *x) const override
| reverse transform correct only when the mapping is a permuation
Public Member Functions inherited from faiss::VectorTransform
| VectorTransform (int d_in=0, int d_out=0)
| ! output dimension
virtual void | train (idx_t n, const float *x)
float * | apply (idx_t n, const float *x) const

## Public Attributes
std::vector< int > | map
Public Attributes inherited from faiss::VectorTransform
int | d_in
int | d_out
| ! input dimension
bool | is_trained

## Additional Inherited Members
Public Types inherited from faiss::VectorTransform
typedef Index::idx_t | idx_t

## Detailed Description

remap dimensions for intput vectors, possibly inserting 0s strictly speaking this is also a linear transform but we don't want to compute it with matrix multiplies

Definition at line 203 of file VectorTransform.h.

## Constructor & Destructor Documentation

RemapDimensionsTransform::RemapDimensionsTransform | ( | int | d_in,
|  | int | d_out,
|  | bool | uniform = `true`
| ) |  |

remap input to output, skipping or inserting dimensions as needed if uniform: distribute dimensions uniformly otherwise just take the d_out first ones.

Definition at line 941 of file VectorTransform.cpp.

## Member Data Documentation

std::vector<int> faiss::RemapDimensionsTransform::map

map from output dimension to input, size d_out -1 -> set output to 0

Definition at line 207 of file VectorTransform.h.

The documentation for this struct was generated from the following files:

- /data/users/matthijs/github_faiss/faiss/VectorTransform.h
- /data/users/matthijs/github_faiss/faiss/VectorTransform.cpp