• This project
    • Loading...
  • Sign in

2021-1-capstone-design1 / JJS_Project2

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • JJS_Project2
  • ..
  • test
  • upperRightTriangle.cpp
  • 이재용's avatar
    upload px4 source & 13week report & meeting report(May) · 4e1b7761
    4e1b7761
    이재용 authored 2021-05-31 21:37:01 +0900
upperRightTriangle.cpp 467 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include "test_macros.hpp"
#include <matrix/math.hpp>

using namespace matrix;

int main()
{
    float data[9] = {1, 2, 3,
                     4, 5, 6,
                     7, 8, 10
                    };
    float urt[6] = {1, 2, 3, 5, 6, 10};

    SquareMatrix<float, 3> A(data);

    for(size_t i=0; i<6; i++) {
        TEST(fabs(urt[i] - A.upper_right_triangle()(i)) < FLT_EPSILON);
    }

    return 0;
}

/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */