Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4618364
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:15:23+00:00 2026-05-22T02:15:23+00:00

template<class T,class TV> struct CONJUGATE_GRADIENTS_HELPER{ DEFORMABLE_OBJECT<T,TV>* deformable_object; int partition_id; T time,dt; T alpha,beta; ARRAY<TV>*

  • 0
  template<class T,class TV> struct CONJUGATE_GRADIENTS_HELPER{
      DEFORMABLE_OBJECT<T,TV>* deformable_object;
      int partition_id;
      T time,dt;
      T alpha,beta;
      ARRAY<TV>* dX_full;
      ARRAY<double> *S_dot_Q_partial,*rho_new_partial,*supnorm_partial;
  };

  typedef CONJUGATE_GRADIENTS_HELPER<T,TV> T_CG_HELPER;
  ARRAY<double> S_dot_Q_partial(particles.particle_ranges->m);
  ARRAY<T_CG_HELPER> helpers(particles.particle_ranges->m);

  for(int p=1;p<=particles.particle_ranges->m;p++){
          helpers(p).deformable_object=this;
          helpers(p).partition_id=p;
          helpers(p).time=time;
          helpers(p).beta=beta;
          helpers(p).S_dot_Q_partial=&S_dot_Q_partial;
  }

What do the brackets in helpers(p) stand for? How can we iterate through helpers since helpers is a single object

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:15:24+00:00Added an answer on May 22, 2026 at 2:15 am

    Off goes the psychic answer, since I don’t know what ARRAY exactly is…

    It seems your ARRAY class template overloads the function call operator operator() instead of the index operator operator[]. Just use it as if those () brackets where normal array indexing brackets [].
    Also, your code clearly shows a way to iterate over helpers with the for-loop…

    Anyway, for further help we need to see some code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class like template <class T> struct A{ template <class U> A(U
I have the following code: template <class T> struct pointer { operator pointer<const T>()
I have a template class like below. template<int S> class A { private: char
regarding my Point struct already mentioned here: template class: ctor against function -> new
C++03 allows to create template class which inheritances from template parameters: // c++03 struct
class RunAround; class HopUpAndDown; class Sleep; template<typename Acts> int doThis(); template<> int doThis<RunAround>() {
Given a C++ template class (or function) definition: template<typename T> struct Foo { T
I have a template class in C++ (somewhat simplified): template<typename T> struct C {
the template code is like this: template <class type1> struct DefaultInstanceCreator { type1 *
For an arbitrary class, template<class T> struct S { S() { cout << hello

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.