Comments (7)
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.
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.
@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.
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.
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.
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.
Test cases added.
Original comment by [email protected]
on 20 Jun 2009 at 11:36
- Changed state: Fixed
from igraphhpp.
Related Issues (13)
- Implement BA & ER model for simple (non-duplicating edge) graphs HOT 5
- interface of function call with multiple return value HOT 2
- Revised the Vector constructor HOT 6
- Provide a link to the source code of each .cpp file in regression test HOT 2
- tasks
- segmentation in GraphWriter HOT 1
- design problem in the ReferenceVector HOT 1
- Branch, automatic test HOT 6
- seg fault while assigning graph to ReferenceVector<Graph> via operator [] HOT 1
- Remove g++-4.3_gnu++0x from the regression test. HOT 1
- bugs in resizing a ReferenceVector HOT 1
- Revise all XXINTRNL_TEMP_RETURN_PTRVEC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igraphhpp.