public class FixIndexSquaredNormCache extends Object implements SquaredNormCache
Constructor and Description |
---|
FixIndexSquaredNormCache(int cacheSize)
Initializes a cache with a defined dimension for squared norms
|
Modifier and Type | Method and Description |
---|---|
Float |
getSquaredNorm(Example example)
Returns a previously stored norm of a given example
|
void |
setSquaredNormVaue(Example example,
float squaredNorm)
Stores a squared norm in the cache
|
public FixIndexSquaredNormCache(int cacheSize)
cacheSize
- the number of squared norms the cache can simultaneously storepublic Float getSquaredNorm(Example example)
SquaredNormCache
getSquaredNorm
in interface SquaredNormCache
example
- the instance whose squared norm is requirednull
if a cache miss occurspublic void setSquaredNormVaue(Example example, float squaredNorm)
SquaredNormCache
setSquaredNormVaue
in interface SquaredNormCache
example
- the example whose quadratic norm must be storedsquaredNorm
- the squared norm to be storedCopyright © 2014 Semantic Analytics Group @ Uniroma2. All rights reserved.