/**
 * 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 <stdint-gcc.h>


class Vector;

class Matrix {


public:
    int64_t m_;
    int64_t n_;

    Matrix();

    explicit Matrix(int64_t, int64_t);

    virtual ~Matrix() = default;

    int64_t size(int64_t dim) const;

    virtual double dotRow(const Vector &, int64_t) const = 0;

    virtual void addVectorToRow(const Vector &, int64_t, double) = 0;

    virtual void addRowToVector(Vector &x, int32_t i) const = 0;

    virtual void addRowToVector(Vector &x, int32_t i, double a) const = 0;

    virtual void save(std::ostream &) const = 0;

    virtual void load(std::istream &) = 0;

    virtual void dump(std::ostream &) const = 0;
};

