Sha256: 49f2b47a84b30680c9b1e3486e3c736bb8e767eb723f666fc2c967d9cefbcf80

Contents?: true

Size: 972 Bytes

Versions: 11

Compression:

Stored size: 972 Bytes

Contents

/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <cstdint>
#include <istream>
#include <ostream>
#include <vector>

#include <assert.h>
#include "real.h"

namespace fasttext {

class Vector;

class Matrix {
 protected:
  int64_t m_;
  int64_t n_;

 public:
  Matrix();
  explicit Matrix(int64_t, int64_t);
  virtual ~Matrix() = default;

  int64_t size(int64_t dim) const;

  virtual real dotRow(const Vector&, int64_t) const = 0;
  virtual void addVectorToRow(const Vector&, int64_t, real) = 0;
  virtual void addRowToVector(Vector& x, int32_t i) const = 0;
  virtual void addRowToVector(Vector& x, int32_t i, real a) const = 0;
  virtual void save(std::ostream&) const = 0;
  virtual void load(std::istream&) = 0;
  virtual void dump(std::ostream&) const = 0;
};

} // namespace fasttext

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fasttext-0.4.0 vendor/fastText/src/matrix.h
fasttext-0.3.0 vendor/fastText/src/matrix.h
fasttext-0.2.4 vendor/fastText/src/matrix.h
fasttext-0.2.3 vendor/fastText/src/matrix.h
fasttext-0.2.2 vendor/fastText/src/matrix.h
fasttext-0.2.1 vendor/fastText/src/matrix.h
fasttext-0.2.0 vendor/fastText/src/matrix.h
fasttext-0.1.3 vendor/fastText/src/matrix.h
fasttext-0.1.2 vendor/fastText/src/matrix.h
fasttext-0.1.1 vendor/fastText/src/matrix.h
fasttext-0.1.0 vendor/fastText/src/matrix.h