Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-05-06 06:46:07


Hi,

Not a full review of fusion, but just some (slightly confused...apologies)
thoughts. I started to look into fusion to try to understand what it is exactly.
I have an idea what it might be about so I decided to look in the examples
directory. Is there only one example? I am surprised. is that due to lack of
time? There also doesnt seem to be much in way of examples in the documentation.

Would it be possible to have a simple definition of what a view is, as it doesnt
seem to be defined anywhere, or is it? How expensive is it to construct a view
at runtime. Is it likely that the view is easy for the compiler to optimise (IOW
so that the actual code references the original sequence).

I am kind of interested in this library ( though unsure if it can help exactly
with my problems), I have a matrix which is in fact a tuple of tuples and I'm
wondering if fusion could help me in iterating over it. For example currently I
am writing out each co_factor function explicitly ( of which there are 16)
though I presume it would be possible to find the generic algorithm, so writing
one function:

// cofactor function of 3D homogeneous matrix
// constrained to cofactor(0,0) using enable_if

 template<int R, int C>
        typename boost::enable_if_c<
            R == 0 && C ==0,
            value_type
>::type
        cofactor()const
        {
            value_type t
                = ( this->at<1,1>()
                        * ( this->at<2,2>() * this->at<3,3>() - this->at<2,3>()
* this->at<3,2>())
                    - this->at<1,2>()
                        * ( this->at<2,1>() * this->at<3,3>() - this->at<2,3>()
* this->at<3,1>())
                    + this->at<1,3>()
                        * ( this->at<2,1>() * this->at<3,2>() - this->at<2,2>()
* this->at<3,1>())
                 );
            return t;
        }

There probably isnt enough detail here to provide a solution to this particular
problem, but does it look like the sort of problem that fusion could help with?.

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk