mandelbrot/utils.cpp
2022-07-06 19:20:48 +02:00

102 lines
2.1 KiB
C++

/*
The GPLv3 License (GPLv3)
Copyright (c) 2022 Akos Horvath
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "utils.h"
#include "./mpreal.h"
using namespace Util;
Vec2i::Vec2i(int x, int y) : x(x), y(y)
{
}
Vec2f::Vec2f(float x, float y) : x(x), y(y)
{
}
Vec2d::Vec2d(double x, double y) : x(x), y(y)
{
}
//BigFloat::BigFloat(uint32_t prec) : precision(prec)
//{
// mpfr_init2(this->val, prec);
//}
//
//BigFloat::~BigFloat()
//{
// //if (this->val->_mpfr_d != nullptr)
// // mpfr_clear(this->val);
//}
//
//BigFloat BigFloat_d(double d, uint32_t prec)
//{
// BigFloat bf = BigFloat(prec);
// bf.setValue(d);
//
// return bf;
//}
//
//BigFloat BigFloat::abs(const BigFloat &bf)
//{
// BigFloat r = BigFloat(bf.precision);
//
// mpfr_abs(r.val, bf.val, MPFR_RNDD);
//
// return r;
//}
//void BigFloat::setValue(double val)
//{
// mpfr_set_d(this->val, val, MPFR_RNDD);
//}
//
//std::string BigFloat::to_str() const
//{
// char buf[this->precision/2];
//
// mpfr_snprintf(buf, this->precision/2, "%.60RNf", this->val);
//
// std::string s(buf);
//
// return s;
//}
void init(uint32_t prec)
{
// mpfr::mpreal::set_default_prec(prec);
}
Vec2mp::Vec2mp(mpfr::mpreal x, mpfr::mpreal y)
: x(x), y(y)
{
}
Vec2mp::Vec2mp(double x, double y)
: x(mpfr::mpreal(x)), y(mpfr::mpreal(y))
{
}
/*
BigFloat operator + (BigFloat const &f);
BigFloat operator - (BigFloat const &f);
BigFloat operator * (BigFloat const &f);
BigFloat operator / (BigFloat const &f);
*/