Re: [proto] How to customize an expression in an EDSL , so as to make a deep copy of it?

2016-01-15 Thread Bart Janssens
Hi Masa,

Good to hear, good luck with your work!

Cheers,

Bart

On Fri, Jan 15, 2016 at 3:19 AM Masakatsu ITO(伊藤) 
wrote:

> Hi Bart and Boost.Proto community,
>
> Thanks to you, I made some progress on my mini-EDSL and
> have given a poster presentation at the small symposium
> of computer science in Japan to discuss about DSLs for
> scientific simulation.
>
> Although my EDSL still has lots of template errors, I hope to
> post its error-free version to GitHub before long.
>
> Best regards,
> Masa
>
>
> Masakatsu ITO
>
>
>
>
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] How to customize an expression in an EDSL , so as to make a deep copy of it?

2016-01-14 Thread 伊藤

Hi Bart and Boost.Proto community,

Thanks to you, I made some progress on my mini-EDSL and
have given a poster presentation at the small symposium
of computer science in Japan to discuss about DSLs for
scientific simulation.

Although my EDSL still has lots of template errors, I hope to
post its error-free version to GitHub before long.

Best regards,
Masa

Masakatsu ITO


On 2015年12月26日 07:11, Bart Janssens wrote:
On Fri, Dec 25, 2015 at 2:07 PM Masakatsu ITO(伊藤) 
> wrote:



Actually I tried to adapt my DiffereneceOperator type to Proto
as Proto Users Guide explains in "Adapting Existing Types to Proto".


http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.define_operators


I think this didn't work because the macro doesn't overload the 
function call operator.


And I wondered when it is necessary to write a code such like

calculator<  proto::terminal<  placeholder<0>  >::type  >  const  _1;


in |"The extends< > Expression Wrapper".


http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.customizing_expressions_in_your_domain.extends
|




This is needed to make sure the terminal is part of the calculator 
domain, if you leave out the calculator<> part you just get an 
expression in the default domain.


Wishing you a merry Christmas,
Masa


Merry Christmas to you too!

Bart


___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] How to customize an expression in an EDSL , so as to make a deep copy of it?

2015-12-25 Thread 伊藤

Hi Bart,

Thank you so much for fixing my source code and giving me
this good starting point for my first mini-EDSL .
I'll try to extend grammar objects and will learn more about Proto.



You can create a proper proto terminal in your domain using:
ExprWrapper const 
opr = {{}};


Actually I tried to adapt my DiffereneceOperator type to Proto
as Proto Users Guide explains in "Adapting Existing Types to Proto".

http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.define_operators


And I wondered when it is necessary to write a code such like

calculator<  proto::terminal<  placeholder<0>   >::type   >  const  _1;


in |"The extends< > Expression Wrapper".

http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.customizing_expressions_in_your_domain.extends
| 



But I now see there's a big difference between these two ways.
although I still don't understand why .


So I'm reading your paper,
"Finite Element Assembly Using an Embedded Domain Specific Language",
Bart Janssens, Támas Bányai, Karim Limam, and Walter Bosschaerts,
Scientific Programming Volume 2015 (2015), Article ID 797325, 22 pages.

It's very interesting and helpful to me.

Wishing you a merry Christmas,
Masa


p.s. It's awfully quiet on this list, is it still the place to discuss 
Proto?



I wish there could be a place where lots of people discuss about
how to use Proto for scientific simulations.



On 2015年12月22日 20:57, Bart Janssens wrote:

Hi Masa,

The problem is that you were not really building a proto expression, 
but just calling your DifferenceOperator directly. You can create a 
proper proto terminal in your domain using:
ExprWrapper const 
opr = {{}};


Once that is done, only the deep copy compiles, but you need a proper 
grammar for evaluation to work, and a << overload for printing and 
starting evaluation. The fixed code with a small start of the grammar 
is attached.


p.s. It's awfully quiet on this list, is it still the place to discuss 
Proto?


Cheers,

Bart

On Mon, Dec 14, 2015 at 12:48 PM Masakatsu ITO(伊藤) 
> wrote:


Hello,

I'm trying to make an EDSL for finite volume method,
which translates a formula of the method into
executable code.

Now I've confirmed that such a formula

 std::cout << MyEDSL::opr( 0.1, 0.1) + 1.0 << std::endl;

can be compiled and prints out the correct answer.



___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] How to customize an expression in an EDSL , so as to make a deep copy of it?

2015-12-25 Thread Bart Janssens
On Fri, Dec 25, 2015 at 2:07 PM Masakatsu ITO(伊藤) 
wrote:

>
> Actually I tried to adapt my DiffereneceOperator type to Proto
> as Proto Users Guide explains in "Adapting Existing Types to Proto".
>
>
> http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.define_operators
>
>
I think this didn't work because the macro doesn't overload the function
call operator.



> And I wondered when it is necessary to write a code such like
>
> calculator< proto::terminal< placeholder<0> >::type > const _1;
>
>
> in "The extends< > Expression Wrapper".
>
>
> http://www.boost.org/doc/libs/1_57_0/doc/html/proto/users_guide.html#boost_proto.users_guide.front_end.customizing_expressions_in_your_domain.extends
>
> 
>

This is needed to make sure the terminal is part of the calculator domain,
if you leave out the calculator<> part you just get an expression in the
default domain.



> Wishing you a merry Christmas,
> Masa
>
>
Merry Christmas to you too!

Bart
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto