我有一个包含几个/******* external function ********/
/****** Example of the split function:
split (r3,r1,true,3,r2,false,6)
r3= 1,2,3,4,5
r1= 1,3,5
r2= 2,5,3,1,4,2
********/
template <typename Key>
Ring<Key> split(const Ring<Key> &source,Ring<Key> &result1, bool dir1, int len1, Ring<Key> &result2, bool dir2, int len2){
typename Ring<Key>::iterator i1 = source.begin();
typename Ring<Key>::iterator i2 = source.begin();
/*I moved second iterator to the 2nd position in original Ring*/
i2++;
if (source.isEmpty()){
cout<<"Empty source Ring"<<endl;}
if (source.length()==1||source.length()==2){
return source;
}
if((len1 <= 0) || (len2 <= 0))
{
cout << "split():(incorrect lengths)" << endl;
}
if(!i1.isNULL()){
for(int i = 0; i < len1; i++)
{
result1.insertLast(i1.getKey());
if(dir1){
i1++;
i1++;;
}
else
{i1--;
i1--;
}}}
cout<<result1;
if(!i2.isNULL()){
for(int i = 0; i < len2; i++)
{
result2.insertLast(i2.getKey());
if(dir2){
i2++;
i2++;
}
else
{i2--;
i2--;
}}}
cout<<result2;}
公式的列表:
lm
我正在寻找一种使用ggplot2绘制每个图的方法,有关如何执行此操作的任何想法? (相同的数据,只有公式会更改)。
示例:
y ~ I(x^0.5), y ~ I(log(x)), ...)