Git Product home page Git Product logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Note that these operations have easy immediate operators but no inplace 
operators, so just wrap the operator& 
to the igraph_*** functions and define operator&= from operator&. No need to 
mess with the tempobj.hpp stuff 
(aside from ::std::move).

Original comment by [email protected] on 16 Jun 2009 at 3:37

  • Added labels: OpSys-All, Component-Logic

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
The supporting operation should be disjoint union, union, intersection, 
difference,
complementer and compose. If we need to add the operator interface, what sohuld 
be
the corresponding operator? I think

union +
intersection *
difference -
complementer !

Also there is some problem about the name igraph_union. The corresponding name 
is the
union which is the reserved word. A replacement maybe merge_union or the 
union_merge.
Any suggestion?

Original comment by [email protected] on 17 Jun 2009 at 4:28

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
@3:

merge(x,y) is fine.

And for the operator interface, what you're describing is the 
Pascal convention. For C++ we can overload the bitwise 
operators as:

Intersection = bit_and = &
Union (Merge) = bit_or = |
Disjoint union = bit_xor = ^
Complement = bit_not = ~

But difference can't be assigned. 

Both conventions are fine to me. 



Original comment by [email protected] on 17 Jun 2009 at 9:31

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Regarding r50,

I said no need to mess with the tempobj.hpp stuff.

For example, you have implemented Graph::intersect(x, y), you can define 
operator& as:

// in .hpp
RETRIEVE_TEMPORARY_CLASS(Graph) operator& (const Graph& x, const Graph& y) 
MAY_THROW_EXCEPTION;
// in .cpp
RETRIEVE_TEMPORARY_CLASS(Graph) operator& (const Graph& x, const Graph& y) 
MAY_THROW_EXCEPTION {
  return Graph::intersect(x, y);
}

and then the operator &= can be defined as
// in .cpp
Graph& Graph::operator&= (const Graph& other) MAY_THROW_EXCEPTION {
  return (*this = *this & other);
}

The IMPLEMENT_ stuff is only needed when &= is easier to define than &, but in 
this case it is just the 
opposite.

Original comment by [email protected] on 18 Jun 2009 at 10:15

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Also, could you please put your functions following the documentation order of 
igraph? The graph operation 
stuff is in Chapter 18, and that should be after the "Reading and Writing 
Graphs from and to Files" part (Chapter 
15).

Original comment by [email protected] on 18 Jun 2009 at 10:52

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Thanks, I have written the operators before I found that it does not take 
advantage
of move semantic. Forget.

All graph operations and 5 operators (^ | & - ~) are added. After writing a test
program, this issue will be marked close.

I will add others after I finish my thesis.

Original comment by [email protected] on 18 Jun 2009 at 4:04

from igraphhpp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Test cases added. 

Original comment by [email protected] on 20 Jun 2009 at 11:36

  • Changed state: Fixed

from igraphhpp.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.