I will be in a conference next week, so i won't have much time to work on this, but i will try to make the spkg asap.
This is the code i tried to write: #include "cbraid.h" #include "braiding.h" #include <iostream> #include <iomanip> #include <fstream> #include <ctime> #include <cstdlib> #include <stdio.h> using namespace CBraid; using namespace Braiding; using namespace std; list<(list<sint16>)> lcf(int n, list<sint16> word) { sint16 i, j, n; list <sint16> word, word2, graph, graphinv; list<sint16>::iterator itw, itg; list<(list<sint16>)> res; list<sint16> factor; B=ArtinBraid(n); B=WordToBraid(word,n); B=B.MakeLCF(); factor.push_back(B.LeftDelta); res.push_back(factor); sint16 i, j, k; ArtinFactor F=ArtinFactor(n); list<ArtinFactor>::iterator it; for(it=B.FactorList.begin(); it!=B.FactorList.end(); it++) { factor.clear(); F=*it; for(i=2; i<=n; i++) { for(j=i; j>1 && F[j]<F[j-1]; j--) { factor.push_back(j-1); k=F[j]; F[j]=F[j-1]; F[j-1]=k; } } res.push_back(factor); } return res; } It is intended to be an adaptation of the braiding routine for left normal forms, with a modification of the PrintBraidWord function to return a list of lists instead of just printing on screen. On 8 jun, 10:45, Volker Braun <vbraun.n...@gmail.com> wrote: > Lets make a spkg first since it needs to be done anyways and then I don't > have to fiddle with the installation. > > Please post your code, even (especially) if it doesn't work. > > Volker > > On Friday, June 8, 2012 7:47:52 AM UTC+1, mmarco wrote: > > > > Then, do you know how to do your computation within c/c++? Do you want > > to > > > use the ArtinBraid or BandBraid class? > > > For the moment, i am working only with the ArtinBraid form. I tried to > > write a small c++ program to implement the left normal form, calling > > WordToBraid and then .LCF but i couldn't even make it to compile. > > > My main idea is basically that: to be able to pass a list of integers > > representing the word of a braid, and get an integer plus a list of > > lists of integers, representing the left normal form. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org