//#####################################################################
// Copyright 2012-2025 Craig Schroeder.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYREGHT.txt.
//#####################################################################
// Class COMPILER_DATA_OPS
//#####################################################################
#ifndef __COMPILER_DATA_OPS__
#define __COMPILER_DATA_OPS__

#include <Core/Arrays/ARRAY.h>
namespace PhysBAM{
template<class T> struct COMPILER_DATA;
template<class T> struct PROGRAM_COMPILER;

template<class T>
struct COMPILER_DATA_OPS
{
    typedef COMPILER_DATA<T> D;
    typedef PROGRAM_COMPILER<T> PC;
    PC* pc=nullptr;
#define REG_F(f) static D f(PC*pc,const ARRAY<D>& in);
#define REG_F1(f) D f(const D& a);REG_F(f);
#define REG_F2(f) D f(const D& a,const D& b);REG_F(f);
    REG_F1(inv);
    REG_F1(sqrt);
    REG_F1(exp);
    REG_F1(ln);
    REG_F1(floor);
    REG_F1(ceil);
    REG_F1(rint);
    REG_F1(abs);
    REG_F1(sin);
    REG_F1(cos);
    REG_F1(asin);
    REG_F1(acos);
    REG_F1(atan);
    REG_F1(tan);
    REG_F1(cot);
    REG_F1(sec);
    REG_F1(csc);
    REG_F1(acot);
    REG_F1(asec);
    REG_F1(acsc);
    REG_F1(trans);
    REG_F1(tr);
    REG_F1(norm2);
    REG_F1(norm);
    REG_F1(det);
    REG_F1(inverse);
    REG_F1(id);
    REG_F1(neg);

    REG_F2(atan2);
    REG_F2(min);
    REG_F2(max);
    REG_F2(pow);
    REG_F2(add);
    REG_F2(sub);
    REG_F2(mul);
    REG_F2(div);
    REG_F2(mod);
    REG_F2(dot);
    REG_F2(cross);
    REG_F2(outer);
    REG_F2(row);
    REG_F2(col);
    D row(const D& a,int k);
    D col(const D& a,int k);

    REG_F(zeros);
    REG_F(ones);
    REG_F(vec);
#undef REG_F
#undef REG_F1
#undef REG_F2
};
}
#endif
