예제 #1
0
/* ioctl dispatch */ 
static int myioctl(struct inode *inode, struct file *f, unsigned int msg, unsigned long param)
{ 
	switch (msg) {
		case kChanEvents:	ChanEvents();
			break;
		case kCommonEvents:	CommonEvents();
			break;
		case kSystemeEx:	SystemeEx ();
			break;
		case kStream:		Stream();
			break;
		case kPrivate:		Private();
			break;
		case kProcess:		Process();
			break;
		case kQFToMidiFile:	QFToMidiFile();
			break;
		case kMidiFile:		MidiFile();
			break;
		case kReserved:		Reserved();
	 		break;
		case kOpen:		OpenAppls();
	 		break;
		case kClose:		Close();
	 		break;
 	}
	return 0;
}
예제 #2
0
namespace CopyCtorIssues {
  struct Private {
    Private();
  private:
    Private(const Private&); // expected-note {{declared private here}}
  };
  struct NoViable {
    NoViable(); // expected-note {{not viable}}
    NoViable(NoViable&); // expected-note {{not viable}}
  };
  struct Ambiguous {
    Ambiguous();
    Ambiguous(const Ambiguous &, int = 0); // expected-note {{candidate}}
    Ambiguous(const Ambiguous &, double = 0); // expected-note {{candidate}}
  };
  struct Deleted {
    Private p; // expected-note {{implicitly deleted}}
  };

  const Private &a = Private(); // expected-warning {{copying variable of type 'CopyCtorIssues::Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
  const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'CopyCtorIssues::NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
#if !CXX98
  const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'CopyCtorIssues::Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
#endif
  const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'CopyCtorIssues::Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
}
예제 #3
0
// actually an LU saving square roots, with an inverted diagonal saving divides
Ref<SparseMatrix > SparseMatrix::
incomplete_cholesky_factorization(const T modified_coefficient,const T zero_tolerance) const
{
    GEODE_ASSERT(rows()==columns());
    initialize_diagonal_index();
    Array<T> C(A.flat.copy());
    for(int i=0;i<rows();i++){ // for each row
        int row_diagonal_index=diagonal_index[i],row_end=J.offsets[i+1];T sum=0;
        for(int k_bar=J.offsets[i];k_bar<row_diagonal_index;k_bar++){ // for all the entries before the diagonal element
            int k=J.flat[k_bar];int row2_diagonal_index=diagonal_index[k],row2_end=J.offsets[k+1];
            C[k_bar]*=C[row2_diagonal_index]; // divide by the diagonal element (which has already been inverted)
            int j_bar=k_bar+1; // start with the next element in the row, when subtracting the dot product
            for(int i_bar=row2_diagonal_index+1;i_bar<row2_end;i_bar++){ // run through the rest of the elements in the row2
                int i=J.flat[i_bar];T dot_product_term=C[k_bar]*C[i_bar];
                while(j_bar<row_end-1 && J.flat[j_bar]<i) j_bar++; // gets j_bar such that j_bar>=i
                if(J.flat[j_bar]==i) C[j_bar]-=dot_product_term;
                else sum+=dot_product_term;}}
        T denominator=C[row_diagonal_index]-modified_coefficient*sum;
        if(i==rows()-1 && denominator<=zero_tolerance) denominator=zero_tolerance; // ensure last diagonal element is not zero
        C[row_diagonal_index]=1/denominator;} // finally, store the diagonal element in inverted form

    return new_<SparseMatrix>(J,Nested<T>::reshape_like(C,J),diagonal_index,true,Private());
}
예제 #4
0
void MetadataHub::reset()
{
    (*d) = Private();
}
예제 #5
0
const QSharedPointer<TaskQueue::TaskThreadPool> &TaskQueue::TaskThreadPool::Instance() { // static
	static auto Pool = MakeShared<TaskThreadPool>(Private());
	return Pool;
}