1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
32262e7c46 Added missing reference 2024-02-17 16:28:09 +01:00
88b458e959 Use QVector as the data container in Matrix 2024-02-17 11:54:07 +01:00
516a944859 Version++ 2024-02-17 11:53:34 +01:00
7 changed files with 11 additions and 44 deletions

View File

@ -1,4 +1,4 @@
version: 13.16.{build}
version: 13.17.{build}
configuration:
- Release

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else {
TARGET = GPXSee
}
VERSION = 13.16
VERSION = 13.17
QT += core \

View File

@ -37,7 +37,7 @@ Unicode true
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "13.16"
!define VERSION "13.17"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -27,7 +27,7 @@ public:
const Data &data) : _tag(tag), _subFields(subFields), _data(data) {}
const QByteArray &tag() const {return _tag;}
const QVector<QByteArray> subFields() const {return _subFields;}
const QVector<QByteArray> &subFields() const {return _subFields;}
const Data &data() const {return _data;}
bool subfield(const char *name, int *val, int idx = 0) const;

View File

@ -3,33 +3,11 @@
#define abs(x) ((x)<0 ? -(x) : (x))
Matrix::~Matrix()
{
delete[] _m;
}
Matrix::Matrix(size_t h, size_t w)
{
_h = h; _w = w;
if (isNull())
_m = 0;
else
_m = new double[_h * _w];
}
Matrix::Matrix(const Matrix& M)
{
_h = M._h; _w = M._w;
if (isNull())
_m = 0;
else
_m = new double[_h * _w];
for (size_t i = 0; i < _h; i++)
for (size_t j = 0; j < _w; j++)
m(i,j) = M.m(i,j);
_h = h;
_w = w;
_m.resize(_h * _w);
}
bool Matrix::eliminate(double epsilon)
@ -87,12 +65,6 @@ Matrix Matrix::augemented(const Matrix &M) const
return A;
}
void Matrix::zeroize()
{
for (size_t i = 0; i < _h * _w; i++)
_m[i] = 0;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Matrix &matrix)
{

View File

@ -3,29 +3,27 @@
#include <cstddef>
#include <cfloat>
#include <QVector>
#include <QDebug>
class Matrix
{
public:
Matrix() {_h = 0; _w = 0; _m = 0;}
Matrix() {_h = 0; _w = 0;}
Matrix(size_t h, size_t w);
Matrix(const Matrix& M);
~Matrix();
size_t h() const {return _h;}
size_t w() const {return _w;}
double &m(size_t i, size_t j) {return _m[_w * i + j];}
double const &m(size_t i, size_t j) const {return _m[_w * i + j];}
double const &m(size_t i, size_t j) const {return _m.at(_w * i + j);}
bool isNull() const {return (_h == 0 || _w == 0);}
void zeroize();
bool eliminate(double epsilon = DBL_EPSILON);
Matrix augemented(const Matrix &M) const;
private:
double *_m;
QVector<double> _m;
size_t _h;
size_t _w;
};

View File

@ -23,7 +23,6 @@ void Transform::simple(const ReferencePoint &p1, const ReferencePoint &p2)
void Transform::affine(const QList<ReferencePoint> &points)
{
Matrix c(3, 2);
c.zeroize();
for (size_t i = 0; i < c.h(); i++) {
for (size_t j = 0; j < c.w(); j++) {
for (int k = 0; k < points.size(); k++) {
@ -40,7 +39,6 @@ void Transform::affine(const QList<ReferencePoint> &points)
}
Matrix Q(3, 3);
Q.zeroize();
for (int qi = 0; qi < points.size(); qi++) {
double v[3];
@ -63,7 +61,6 @@ void Transform::affine(const QList<ReferencePoint> &points)
_img2proj = _proj2img.inverted();
}
Transform::Transform()
: _proj2img(NULL_QTRANSFORM), _img2proj(NULL_QTRANSFORM)
{