Skip to content
Snippets Groups Projects
Commit 5e45e622 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

LAtest DCPSE solver

parent d4ee22da
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,72 @@
#ifndef DCPSE_OP_HPP_
#define DCPSE_OP_HPP_
template<typename operand_type>
class Lap_node
{
operand_type arg;
public:
typedef int it_is_a_node;
Lap_node(operand_type & arg)
:arg(arg)
{}
};
class Lap
{
public:
template<typename operand_type>
Lap_node<operand_type> operator()(operand_type arg)
{
return Lap_node<operand_type>(arg);
}
};
template<typename operand_type1, typename operand_type2>
class plus
{
operand_type1 op1;
operand_type2 op2;
public:
typedef int it_is_a_node;
plus(const operand_type1 & op1, const operand_type2 & op2)
:op1(op1),op2(op2)
{}
void value()
{
//op1.value() + op.value;
}
};
class Field
{
typedef int it_is_a_node;
void value()
{
// add non zero
}
};
template<typename operand_type1, typename operand_type2/*, typename sfinae=typename std::enable_if<
std::is_same<typename operand_type1::it_is_a_node,int>::value
>::type*/ >
plus<operand_type1,operand_type2> operator+(const operand_type1 & op1, const operand_type2 & op2)
{
return plus<operand_type1,operand_type2>(op1,op2);
}
#endif /* DCPSE_OP_HPP_ */
......@@ -7,14 +7,30 @@
#define BOOST_TEST_DYN_LINK
#include "util/util_debug.hpp"
#include <boost/test/unit_test.hpp>
#include <iostream>
#include "DCPSE_op.hpp"
//template<typename T>
//struct Debug;
BOOST_AUTO_TEST_SUITE( dcpse_op_suite_tests )
BOOST_AUTO_TEST_CASE( dcpse_op_tests )
{
std::cout << "TEST" << std::endl;
Lap L;
Field F;
auto expr = L(L(F)) + L(F) + F;
std::cout << demangle(typeid(decltype(expr)).name()) << "\n";
//Debug<decltype(expr)> a;
typedef decltype(expr)::blabla blabla;
auto err = L + L;
}
BOOST_AUTO_TEST_SUITE_END()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment